Skip to content

Commit

Permalink
Review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rquidute committed Jan 6, 2025
1 parent 7cc1017 commit 3720f7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
ADMIN_STORAGE_FILE_HOST,
ADMIN_STORAGE_FILE_HOST_PATH,
PromptOption,
prompt_re_use_commissioning,
prompt_reuse_commissioning,
)

# Command line params
Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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")

Expand Down
7 changes: 4 additions & 3 deletions test_collections/matter/sdk_tests/support/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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:
Expand All @@ -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,
Expand Down

0 comments on commit 3720f7f

Please sign in to comment.