Skip to content

Commit

Permalink
Fix the directory iteration in prepare_speculos_args when looking for…
Browse files Browse the repository at this point in the history
… the main app in plugin mode
  • Loading branch information
fbeutin-ledger committed Feb 21, 2024
1 parent 15a3774 commit 353b8ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ragger/conftest/base_conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ def prepare_speculos_args(root_pytest_dir: Path, firmware: Firmware, display: bo
# project_root_dir / conf.OPTIONAL.APP_DIR. There should be only one subfolder in the path.
app_path = None
if conf.OPTIONAL.LOAD_MAIN_APP_AS_LIBRARY:
app_dir_children = list((project_root_dir / conf.OPTIONAL.APP_DIR).iterdir())
app_dir_children = [child for child in (project_root_dir / conf.OPTIONAL.APP_DIR).iterdir() if child.is_dir()]
if len(app_dir_children) != 1:
raise ValueError(
f"Expected a single folder in {conf.OPTIONAL.APP_DIR}, found {len(app_dir_children)}"
f"Expected a single directory in {conf.OPTIONAL.APP_DIR}, found {len(app_dir_children)}"
)
app_path = find_main_application(app_dir_children[0], device)
# If the app is standalone, the main app should be located in project_root_dir / conf.OPTIONAL.APP_DIR
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/conftests/test_base_conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def prepare_base_dir(directory: Path) -> Tuple[Path, Path]:
(directory / "deps" / "dep" / "build" / "stax" / "bin").mkdir(parents=True, exist_ok=True)
dep_path = (directory / "deps" / "dep" / "build" / "stax" / "bin" / "app.elf")
dep_path.touch()
token_file_path = (directory / "deps" / ".ethereum_application_build_goes_there")
token_file_path.touch()
app_path = (directory / "build" / "stax" / "bin" / "app.elf")
app_path.touch()
return app_path, dep_path
Expand Down

0 comments on commit 353b8ed

Please sign in to comment.