From 725cf64adb660d42c866f9b3265b2b7715451359 Mon Sep 17 00:00:00 2001 From: alexstroke Date: Wed, 21 Feb 2024 18:58:55 +0100 Subject: [PATCH] [fix] hotfix for commands positions Signed-off-by: alexstroke <111361420+astrokov7@users.noreply.github.com> --- client_cli/pytests/README.md | 2 +- client_cli/pytests/src/client_cli/client_cli.py | 6 +++--- client_cli/pytests/src/client_cli/configuration.py | 4 ++++ client_cli/pytests/src/client_cli/iroha.py | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) 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):