diff --git a/client_cli/pytests/README.md b/client_cli/pytests/README.md index f565dc71e26..f702ab4f6ab 100644 --- a/client_cli/pytests/README.md +++ b/client_cli/pytests/README.md @@ -164,7 +164,7 @@ The variables: ```shell CLIENT_CLI_BINARY=/path/to/iroha_client_cli -CLIENT_CLI_CONFIG=/path/to/config.toml +CLIENT_CLI_CONFIG=/path/to/client.toml TORII_API_PORT_MIN=8080 TORII_API_PORT_MAX=8083 ``` diff --git a/client_cli/pytests/src/client_cli/client_cli.py b/client_cli/pytests/src/client_cli/client_cli.py index 26976e25166..a5b0c6af34a 100644 --- a/client_cli/pytests/src/client_cli/client_cli.py +++ b/client_cli/pytests/src/client_cli/client_cli.py @@ -129,7 +129,7 @@ def domain(self, domain: str): :return: The current ClientCli object. :rtype: ClientCli """ - self.command.insert(3, "domain") + self.command.insert(2, "domain") self.command.append("--id=" + domain) self.execute() return self @@ -147,7 +147,7 @@ def account(self, account: str, domain: str, key: str): :return: The current ClientCli object. :rtype: ClientCli """ - self.command.insert(3, "account") + self.command.insert(2, "account") self.command.append("--id=" + account + "@" + domain) self.command.append("--key=ed0120" + key) self.execute() @@ -166,7 +166,7 @@ def asset(self, asset_definition=None, account=None, value_of_value_type=None): :return: The current ClientCli object. :rtype: ClientCli """ - self.command.insert(3, "asset") + self.command.insert(2, "asset") if asset_definition and account and value_of_value_type: self.command.append( "--asset-id=" diff --git a/client_cli/pytests/src/client_cli/configuration.py b/client_cli/pytests/src/client_cli/configuration.py index 86a06a66b4f..5e04cdfbecd 100644 --- a/client_cli/pytests/src/client_cli/configuration.py +++ b/client_cli/pytests/src/client_cli/configuration.py @@ -39,6 +39,10 @@ def load(self, path_config_client_cli): """ if not os.path.exists(path_config_client_cli): raise IOError(f"No config file found at {path_config_client_cli}") + + if not os.path.isfile(path_config_client_cli): + raise IOError(f"The path is not a file: {path_config_client_cli}") + with open(path_config_client_cli, "r", encoding="utf-8") as config_file: self._config = tomlkit.load(config_file) self.file = path_config_client_cli diff --git a/client_cli/pytests/src/client_cli/iroha.py b/client_cli/pytests/src/client_cli/iroha.py index 602bbe8a838..8c35810c21a 100644 --- a/client_cli/pytests/src/client_cli/iroha.py +++ b/client_cli/pytests/src/client_cli/iroha.py @@ -21,7 +21,7 @@ def _execute_command(self, command_name: str): :param command_name: The name of the command to execute. :type command_name: str """ - self.command.insert(3, command_name) + self.command.insert(2, command_name) self.execute() def should(self, *args, **kwargs):