From b2b4ce11086d0c6bc32dc09db9f5c3cd888e7e89 Mon Sep 17 00:00:00 2001 From: alexstroke Date: Fri, 16 Feb 2024 17:43:52 +0100 Subject: [PATCH] [refactor] `list_filter()`` accepts native Python `dict` for more readable Signed-off-by: alexstroke <111361420+astrokov7@users.noreply.github.com> --- client_cli/pytests/poetry.lock | 74 +++++++++---------- .../pytests/src/client_cli/client_cli.py | 26 +++---- .../pytests/src/client_cli/configuration.py | 10 ++- client_cli/pytests/src/client_cli/iroha.py | 21 +++--- .../accounts/test_accounts_query_filters.py | 6 +- .../test/assets/test_assets_query_filters.py | 20 +++-- .../domains/test_domains_query_filters.py | 4 +- 7 files changed, 85 insertions(+), 76 deletions(-) diff --git a/client_cli/pytests/poetry.lock b/client_cli/pytests/poetry.lock index 477c380f2ab..f46e771b829 100644 --- a/client_cli/pytests/poetry.lock +++ b/client_cli/pytests/poetry.lock @@ -32,13 +32,13 @@ pluggy = ">=0.4.0" [[package]] name = "astroid" -version = "2.15.5" +version = "2.15.8" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.7.2" files = [ - {file = "astroid-2.15.5-py3-none-any.whl", hash = "sha256:078e5212f9885fa85fbb0cf0101978a336190aadea6e13305409d099f71b2324"}, - {file = "astroid-2.15.5.tar.gz", hash = "sha256:1039262575027b441137ab4a62a793a9b43defb42c32d5670f38686207cd780f"}, + {file = "astroid-2.15.8-py3-none-any.whl", hash = "sha256:1aa149fc5c6589e3d0ece885b4491acd80af4f087baafa3fb5203b113e68cd3c"}, + {file = "astroid-2.15.8.tar.gz", hash = "sha256:6c107453dffee9055899705de3c9ead36e74119cee151e5a9aaf7f0b0e020a6a"}, ] [package.dependencies] @@ -199,43 +199,43 @@ files = [ [[package]] name = "cryptography" -version = "42.0.2" +version = "42.0.3" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-42.0.2-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:701171f825dcab90969596ce2af253143b93b08f1a716d4b2a9d2db5084ef7be"}, - {file = "cryptography-42.0.2-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:61321672b3ac7aade25c40449ccedbc6db72c7f5f0fdf34def5e2f8b51ca530d"}, - {file = "cryptography-42.0.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea2c3ffb662fec8bbbfce5602e2c159ff097a4631d96235fcf0fb00e59e3ece4"}, - {file = "cryptography-42.0.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b15c678f27d66d247132cbf13df2f75255627bcc9b6a570f7d2fd08e8c081d2"}, - {file = "cryptography-42.0.2-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:8e88bb9eafbf6a4014d55fb222e7360eef53e613215085e65a13290577394529"}, - {file = "cryptography-42.0.2-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:a047682d324ba56e61b7ea7c7299d51e61fd3bca7dad2ccc39b72bd0118d60a1"}, - {file = "cryptography-42.0.2-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:36d4b7c4be6411f58f60d9ce555a73df8406d484ba12a63549c88bd64f7967f1"}, - {file = "cryptography-42.0.2-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:a00aee5d1b6c20620161984f8ab2ab69134466c51f58c052c11b076715e72929"}, - {file = "cryptography-42.0.2-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:b97fe7d7991c25e6a31e5d5e795986b18fbbb3107b873d5f3ae6dc9a103278e9"}, - {file = "cryptography-42.0.2-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:5fa82a26f92871eca593b53359c12ad7949772462f887c35edaf36f87953c0e2"}, - {file = "cryptography-42.0.2-cp37-abi3-win32.whl", hash = "sha256:4b063d3413f853e056161eb0c7724822a9740ad3caa24b8424d776cebf98e7ee"}, - {file = "cryptography-42.0.2-cp37-abi3-win_amd64.whl", hash = "sha256:841ec8af7a8491ac76ec5a9522226e287187a3107e12b7d686ad354bb78facee"}, - {file = "cryptography-42.0.2-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:55d1580e2d7e17f45d19d3b12098e352f3a37fe86d380bf45846ef257054b242"}, - {file = "cryptography-42.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28cb2c41f131a5758d6ba6a0504150d644054fd9f3203a1e8e8d7ac3aea7f73a"}, - {file = "cryptography-42.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b9097a208875fc7bbeb1286d0125d90bdfed961f61f214d3f5be62cd4ed8a446"}, - {file = "cryptography-42.0.2-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:44c95c0e96b3cb628e8452ec060413a49002a247b2b9938989e23a2c8291fc90"}, - {file = "cryptography-42.0.2-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:2f9f14185962e6a04ab32d1abe34eae8a9001569ee4edb64d2304bf0d65c53f3"}, - {file = "cryptography-42.0.2-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:09a77e5b2e8ca732a19a90c5bca2d124621a1edb5438c5daa2d2738bfeb02589"}, - {file = "cryptography-42.0.2-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ad28cff53f60d99a928dfcf1e861e0b2ceb2bc1f08a074fdd601b314e1cc9e0a"}, - {file = "cryptography-42.0.2-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:130c0f77022b2b9c99d8cebcdd834d81705f61c68e91ddd614ce74c657f8b3ea"}, - {file = "cryptography-42.0.2-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:fa3dec4ba8fb6e662770b74f62f1a0c7d4e37e25b58b2bf2c1be4c95372b4a33"}, - {file = "cryptography-42.0.2-cp39-abi3-win32.whl", hash = "sha256:3dbd37e14ce795b4af61b89b037d4bc157f2cb23e676fa16932185a04dfbf635"}, - {file = "cryptography-42.0.2-cp39-abi3-win_amd64.whl", hash = "sha256:8a06641fb07d4e8f6c7dda4fc3f8871d327803ab6542e33831c7ccfdcb4d0ad6"}, - {file = "cryptography-42.0.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:087887e55e0b9c8724cf05361357875adb5c20dec27e5816b653492980d20380"}, - {file = "cryptography-42.0.2-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:a7ef8dd0bf2e1d0a27042b231a3baac6883cdd5557036f5e8df7139255feaac6"}, - {file = "cryptography-42.0.2-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4383b47f45b14459cab66048d384614019965ba6c1a1a141f11b5a551cace1b2"}, - {file = "cryptography-42.0.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:fbeb725c9dc799a574518109336acccaf1303c30d45c075c665c0793c2f79a7f"}, - {file = "cryptography-42.0.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:320948ab49883557a256eab46149df79435a22d2fefd6a66fe6946f1b9d9d008"}, - {file = "cryptography-42.0.2-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5ef9bc3d046ce83c4bbf4c25e1e0547b9c441c01d30922d812e887dc5f125c12"}, - {file = "cryptography-42.0.2-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:52ed9ebf8ac602385126c9a2fe951db36f2cb0c2538d22971487f89d0de4065a"}, - {file = "cryptography-42.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:141e2aa5ba100d3788c0ad7919b288f89d1fe015878b9659b307c9ef867d3a65"}, - {file = "cryptography-42.0.2.tar.gz", hash = "sha256:e0ec52ba3c7f1b7d813cd52649a5b3ef1fc0d433219dc8c93827c57eab6cf888"}, + {file = "cryptography-42.0.3-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:de5086cd475d67113ccb6f9fae6d8fe3ac54a4f9238fd08bfdb07b03d791ff0a"}, + {file = "cryptography-42.0.3-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:935cca25d35dda9e7bd46a24831dfd255307c55a07ff38fd1a92119cffc34857"}, + {file = "cryptography-42.0.3-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20100c22b298c9eaebe4f0b9032ea97186ac2555f426c3e70670f2517989543b"}, + {file = "cryptography-42.0.3-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2eb6368d5327d6455f20327fb6159b97538820355ec00f8cc9464d617caecead"}, + {file = "cryptography-42.0.3-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:39d5c93e95bcbc4c06313fc6a500cee414ee39b616b55320c1904760ad686938"}, + {file = "cryptography-42.0.3-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:3d96ea47ce6d0055d5b97e761d37b4e84195485cb5a38401be341fabf23bc32a"}, + {file = "cryptography-42.0.3-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:d1998e545081da0ab276bcb4b33cce85f775adb86a516e8f55b3dac87f469548"}, + {file = "cryptography-42.0.3-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:93fbee08c48e63d5d1b39ab56fd3fdd02e6c2431c3da0f4edaf54954744c718f"}, + {file = "cryptography-42.0.3-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:90147dad8c22d64b2ff7331f8d4cddfdc3ee93e4879796f837bdbb2a0b141e0c"}, + {file = "cryptography-42.0.3-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:4dcab7c25e48fc09a73c3e463d09ac902a932a0f8d0c568238b3696d06bf377b"}, + {file = "cryptography-42.0.3-cp37-abi3-win32.whl", hash = "sha256:1e935c2900fb53d31f491c0de04f41110351377be19d83d908c1fd502ae8daa5"}, + {file = "cryptography-42.0.3-cp37-abi3-win_amd64.whl", hash = "sha256:762f3771ae40e111d78d77cbe9c1035e886ac04a234d3ee0856bf4ecb3749d54"}, + {file = "cryptography-42.0.3-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:0d3ec384058b642f7fb7e7bff9664030011ed1af8f852540c76a1317a9dd0d20"}, + {file = "cryptography-42.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35772a6cffd1f59b85cb670f12faba05513446f80352fe811689b4e439b5d89e"}, + {file = "cryptography-42.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:04859aa7f12c2b5f7e22d25198ddd537391f1695df7057c8700f71f26f47a129"}, + {file = "cryptography-42.0.3-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:c3d1f5a1d403a8e640fa0887e9f7087331abb3f33b0f2207d2cc7f213e4a864c"}, + {file = "cryptography-42.0.3-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:df34312149b495d9d03492ce97471234fd9037aa5ba217c2a6ea890e9166f151"}, + {file = "cryptography-42.0.3-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:de4ae486041878dc46e571a4c70ba337ed5233a1344c14a0790c4c4be4bbb8b4"}, + {file = "cryptography-42.0.3-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:0fab2a5c479b360e5e0ea9f654bcebb535e3aa1e493a715b13244f4e07ea8eec"}, + {file = "cryptography-42.0.3-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:25b09b73db78facdfd7dd0fa77a3f19e94896197c86e9f6dc16bce7b37a96504"}, + {file = "cryptography-42.0.3-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:d5cf11bc7f0b71fb71af26af396c83dfd3f6eed56d4b6ef95d57867bf1e4ba65"}, + {file = "cryptography-42.0.3-cp39-abi3-win32.whl", hash = "sha256:0fea01527d4fb22ffe38cd98951c9044400f6eff4788cf52ae116e27d30a1ba3"}, + {file = "cryptography-42.0.3-cp39-abi3-win_amd64.whl", hash = "sha256:2619487f37da18d6826e27854a7f9d4d013c51eafb066c80d09c63cf24505306"}, + {file = "cryptography-42.0.3-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ead69ba488f806fe1b1b4050febafdbf206b81fa476126f3e16110c818bac396"}, + {file = "cryptography-42.0.3-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:20180da1b508f4aefc101cebc14c57043a02b355d1a652b6e8e537967f1e1b46"}, + {file = "cryptography-42.0.3-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:5fbf0f3f0fac7c089308bd771d2c6c7b7d53ae909dce1db52d8e921f6c19bb3a"}, + {file = "cryptography-42.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:c23f03cfd7d9826cdcbad7850de67e18b4654179e01fe9bc623d37c2638eb4ef"}, + {file = "cryptography-42.0.3-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:db0480ffbfb1193ac4e1e88239f31314fe4c6cdcf9c0b8712b55414afbf80db4"}, + {file = "cryptography-42.0.3-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:6c25e1e9c2ce682d01fc5e2dde6598f7313027343bd14f4049b82ad0402e52cd"}, + {file = "cryptography-42.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9541c69c62d7446539f2c1c06d7046aef822940d248fa4b8962ff0302862cc1f"}, + {file = "cryptography-42.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:1b797099d221df7cce5ff2a1d272761d1554ddf9a987d3e11f6459b38cd300fd"}, + {file = "cryptography-42.0.3.tar.gz", hash = "sha256:069d2ce9be5526a44093a0991c450fe9906cdf069e0e7cd67d9dee49a62b9ebe"}, ] [package.dependencies] @@ -741,4 +741,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "6152e8ad6a2aae13baefba435c2a73ce6e2a7d6e3c0a24c88285f7c0526e7a86" +content-hash = "04f8d471669f9b089470787b9c56ec3b618986aa78efffd4c46892da9056945b" diff --git a/client_cli/pytests/src/client_cli/client_cli.py b/client_cli/pytests/src/client_cli/client_cli.py index f5b31cef2c1..6f939018035 100644 --- a/client_cli/pytests/src/client_cli/client_cli.py +++ b/client_cli/pytests/src/client_cli/client_cli.py @@ -120,7 +120,7 @@ def list_filter(self, filter_criteria): """ self.command.append("list") self.command.append("filter") - self.command.append(filter_criteria) + self.command.append(str(filter_criteria)) return self def domain(self, domain: str): @@ -358,18 +358,18 @@ def _execute_pipe(self, cmd1, cmd2): """ Executes two commands connected by a pipe. """ - with (subprocess.Popen( - cmd1, - stdout=subprocess.PIPE, - env=self.config.env - ) as proc1, + with ( + subprocess.Popen( + cmd1, stdout=subprocess.PIPE, env=self.config.env + ) as proc1, subprocess.Popen( cmd2, stdin=proc1.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE, - env=self.config.env - ) as proc2): + env=self.config.env, + ) as proc2, + ): self.stdout, self.stderr = proc2.communicate() self.transaction_hash = extract_hash(self.stdout) self._attach_allure_reports() @@ -379,11 +379,11 @@ def _execute_single(self, command): Executes a single command. """ with subprocess.Popen( - command, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - text=True, - env=self.config.env + command, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + env=self.config.env, ) as process: self.stdout, self.stderr = process.communicate() self.transaction_hash = extract_hash(self.stdout) diff --git a/client_cli/pytests/src/client_cli/configuration.py b/client_cli/pytests/src/client_cli/configuration.py index bfaae2468b0..86a06a66b4f 100644 --- a/client_cli/pytests/src/client_cli/configuration.py +++ b/client_cli/pytests/src/client_cli/configuration.py @@ -39,7 +39,7 @@ 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}") - with open(path_config_client_cli, 'r', encoding='utf-8') as config_file: + 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 @@ -92,7 +92,9 @@ def randomise_torii_url(self): """ parsed_url = urlparse(self._config["torii_url"]) random_port = random.randint(self.port_min, self.port_max) - self._envs["TORII_URL"] = parsed_url._replace(netloc=f"{parsed_url.hostname}:{random_port}").geturl() + self._envs["TORII_URL"] = parsed_url._replace( + netloc=f"{parsed_url.hostname}:{random_port}" + ).geturl() @property def torii_url(self): @@ -124,7 +126,7 @@ def account_id(self): :return: The ACCOUNT_ID. :rtype: str """ - return self._config['account']["id"] + return self._config["account"]["id"] @property def account_name(self): @@ -154,4 +156,4 @@ def public_key(self): :return: The public key. :rtype: str """ - return self._config["account"]['public_key'].split('ed0120')[1] + return self._config["account"]["public_key"].split("ed0120")[1] diff --git a/client_cli/pytests/src/client_cli/iroha.py b/client_cli/pytests/src/client_cli/iroha.py index 05166a2ed83..602bbe8a838 100644 --- a/client_cli/pytests/src/client_cli/iroha.py +++ b/client_cli/pytests/src/client_cli/iroha.py @@ -54,15 +54,18 @@ def domains(self) -> Dict[str, Dict]: :return: List of domains ids. :rtype: List[str] """ - self._execute_command('domain') - try: - domains = json.loads(self.stdout) - except json.decoder.JSONDecodeError as e: - print(f"JSON decode error occurred with this input:", self.stdout) - print(f"STDERR:", self.stderr) - raise - domains_dict = { domain["id"]: domain for domain in domains } - return domains_dict + self._execute_command("domain") + if self.stdout is not None: + try: + domains = json.loads(self.stdout) + except json.decoder.JSONDecodeError: + print("JSON decode error occurred with this input:", self.stdout) + print("STDERR:", self.stderr) + raise + domains_dict = {domain["id"]: domain for domain in domains} + return domains_dict + else: + return {} def accounts(self) -> List[str]: """ diff --git a/client_cli/pytests/test/accounts/test_accounts_query_filters.py b/client_cli/pytests/test/accounts/test_accounts_query_filters.py index c4bc6c80d29..bb13afe52bf 100644 --- a/client_cli/pytests/test/accounts/test_accounts_query_filters.py +++ b/client_cli/pytests/test/accounts/test_accounts_query_filters.py @@ -13,7 +13,7 @@ def condition(): f"WHEN client_cli query accounts " f'in the "{domain}" domain' ): accounts = iroha.list_filter( - f'{{"Identifiable": {{"EndsWith": "@{domain}"}}}}' + {"Identifiable": {"EndsWith": f"@{domain}"}} ).accounts() with allure.step("THEN Iroha should return only accounts with this domain"): allure.attach( @@ -31,7 +31,7 @@ def condition(): name = GIVEN_registered_account.name with allure.step(f'WHEN client_cli query accounts with name "{name}"'): accounts = iroha.list_filter( - f'{{"Identifiable": {{"StartsWith": "{name}@"}}}}' + {"Identifiable": {"StartsWith": f"{name}@"}} ).accounts() with allure.step("THEN Iroha should return only accounts with this name"): allure.attach( @@ -53,7 +53,7 @@ def condition(): f'WHEN client_cli query accounts with account id "{account_id}"' ): accounts = iroha.list_filter( - f'{{"Identifiable": {{"Is": "{account_id}"}}}}' + {"Identifiable": {"Is": account_id}} ).accounts() with allure.step("THEN Iroha should return only accounts with this id"): allure.attach( diff --git a/client_cli/pytests/test/assets/test_assets_query_filters.py b/client_cli/pytests/test/assets/test_assets_query_filters.py index d690b6981ca..1a44e6e8683 100644 --- a/client_cli/pytests/test/assets/test_assets_query_filters.py +++ b/client_cli/pytests/test/assets/test_assets_query_filters.py @@ -13,9 +13,17 @@ def condition(): ) with allure.step(f"WHEN client_cli query assets" f'in the "{domain}" domain'): assets = iroha.list_filter( - '{"Or": [{"Identifiable": {"Contains": "#' + domain + '#"}}, ' - '{"And": [{"Identifiable": {"Contains": "##"}}, ' - '{"Identifiable": {"EndsWith": "@' + domain + '"}}]}]}' + { + "Or": [ + {"Identifiable": {"Contains": f"#{domain}#"}}, + { + "And": [ + {"Identifiable": {"Contains": "##"}}, + {"Identifiable": {"EndsWith": f"@{domain}"}}, + ] + }, + ] + } ).assets() with allure.step("THEN Iroha should return only assets with this domain"): allure.attach( @@ -40,7 +48,7 @@ def condition(): ) with allure.step(f'WHEN client_cli query assets with name "{name}"'): assets = iroha.list_filter( - f'{{"Identifiable": {{"StartsWith": "{name}#"}}}}' + {"Identifiable": {"StartsWith": f"{name}#"}} ).assets() with allure.step("THEN Iroha should return only assets with this name"): allure.attach( @@ -66,9 +74,7 @@ def condition(): + GIVEN_currently_authorized_account.domain ) with allure.step(f'WHEN client_cli query assets with asset id "{asset_id}"'): - assets = iroha.list_filter( - f'{{"Identifiable": {{"Is": "{asset_id}"}}}}' - ).assets() + assets = iroha.list_filter({"Identifiable": {"Is": asset_id}}).assets() with allure.step("THEN Iroha should return only assets with this id"): allure.attach( json.dumps(assets), diff --git a/client_cli/pytests/test/domains/test_domains_query_filters.py b/client_cli/pytests/test/domains/test_domains_query_filters.py index 53ab009b1cf..7f0cfed50c8 100644 --- a/client_cli/pytests/test/domains/test_domains_query_filters.py +++ b/client_cli/pytests/test/domains/test_domains_query_filters.py @@ -11,9 +11,7 @@ def condition(): with allure.step( f'WHEN client_cli query domains filtered by name "{domain_name}"' ): - domains = iroha.list_filter( - f'{{"Identifiable": {{"Is": "{domain_name}"}}}}' - ).domains() + domains = iroha.list_filter({"Identifiable": {"Is": domain_name}}).domains() with allure.step( f'THEN Iroha should return only return domains with "{domain_name}" name' ):