From 3720f7f633927b75fca77e48d93a87998f12f50d Mon Sep 17 00:00:00 2001 From: Romulo Quidute Filho Date: Mon, 6 Jan 2025 13:02:01 +0000 Subject: [PATCH] Review fixes --- .../sdk_tests/support/python_testing/models/test_suite.py | 6 +----- .../sdk_tests/support/python_testing/models/utils.py | 6 +++--- test_collections/matter/sdk_tests/support/utils.py | 7 ++++--- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py b/test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py index 14d0c233..396baec5 100644 --- a/test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py +++ b/test_collections/matter/sdk_tests/support/python_testing/models/test_suite.py @@ -30,11 +30,7 @@ ) from ...sdk_container import SDKContainer -from ...utils import ( - PromptOption, - prompt_for_commissioning_mode, - prompt_re_use_commissioning, -) +from ...utils import PromptOption, prompt_for_commissioning_mode from .utils import ( DUTCommissioningError, commission_device, diff --git a/test_collections/matter/sdk_tests/support/python_testing/models/utils.py b/test_collections/matter/sdk_tests/support/python_testing/models/utils.py index 4283e213..111998c6 100644 --- a/test_collections/matter/sdk_tests/support/python_testing/models/utils.py +++ b/test_collections/matter/sdk_tests/support/python_testing/models/utils.py @@ -40,7 +40,7 @@ ADMIN_STORAGE_FILE_HOST, ADMIN_STORAGE_FILE_HOST_PATH, PromptOption, - prompt_re_use_commissioning, + prompt_reuse_commissioning, ) # Command line params @@ -167,7 +167,7 @@ async def commission_device( raise DUTCommissioningError("Failed to commission DUT") # Copy admin_storage.json file from container, in case the user wants to - # re-use this information in the next execution + # reuse this information in the next execution __copy_admin_storage_file(config, logger) @@ -203,7 +203,7 @@ async def should_perform_new_commissioning( # the previous commissioning information or if it should perform a # new commissioning if ADMIN_STORAGE_FILE_HOST.exists(): - user_response = await prompt_re_use_commissioning(prompt_support, logger) + user_response = await prompt_reuse_commissioning(prompt_support, logger) if user_response == PromptOption.PASS: logger.info(f"Copying file {str(ADMIN_STORAGE_FILE_HOST)} to container") diff --git a/test_collections/matter/sdk_tests/support/utils.py b/test_collections/matter/sdk_tests/support/utils.py index 632793b2..a228c61a 100644 --- a/test_collections/matter/sdk_tests/support/utils.py +++ b/test_collections/matter/sdk_tests/support/utils.py @@ -26,7 +26,8 @@ from app.user_prompt_support.user_prompt_support import UserPromptSupport ADMIN_STORAGE_FILE_DEFAULT_NAME = "admin_storage.json" -ADMIN_STORAGE_FILE_HOST_PATH = Path("/app/backend") +# Retrieve the root folder +ADMIN_STORAGE_FILE_HOST_PATH = Path(__file__).parents[3].parent ADMIN_STORAGE_FILE_HOST = ADMIN_STORAGE_FILE_HOST_PATH.joinpath( ADMIN_STORAGE_FILE_DEFAULT_NAME ) @@ -94,7 +95,7 @@ async def prompt_for_commissioning_mode( return prompt_response -async def prompt_re_use_commissioning( +async def prompt_reuse_commissioning( prompt_support: UserPromptSupport, logger: loguru.Logger, ) -> PromptOption: @@ -106,7 +107,7 @@ async def prompt_re_use_commissioning( prompt_response = await __prompt_pass_fail_options( prompt_support=prompt_support, logger=logger, - prompt="Do you want to re-use the previous commissioning information?\n" + prompt="Do you want to reuse the previous commissioning information?\n" "If you select NO, a new commissioning will be performed", options=options, on_success=None,