Skip to content

Commit c8a77a3

Browse files
Refactor safe key-display boundary inventory derivation
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 286cace commit c8a77a3

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

tests/test_safe_key_display_helper_import_boundary.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
import pytest
55

6+
from tests.test_safe_key_display_helper_usage import ALLOWED_SAFE_KEY_DISPLAY_CALL_FILES
7+
68
pytestmark = pytest.mark.architecture
79

810

9-
EXPECTED_SAFE_KEY_DISPLAY_IMPORTERS = (
10-
"hyperbrowser/client/managers/list_parsing_utils.py",
11-
"tests/test_mapping_utils.py",
12-
)
11+
EXPECTED_SAFE_KEY_DISPLAY_EXTRA_IMPORTERS = ("tests/test_mapping_utils.py",)
1312

1413

1514
def _imports_safe_key_display_helper(module_text: str) -> bool:
@@ -37,4 +36,12 @@ def test_safe_key_display_helper_imports_are_centralized():
3736
if _imports_safe_key_display_helper(module_text):
3837
discovered_modules.append(module_path.as_posix())
3938

40-
assert discovered_modules == list(EXPECTED_SAFE_KEY_DISPLAY_IMPORTERS)
39+
expected_runtime_modules = sorted(
40+
f"hyperbrowser/{path.as_posix()}"
41+
for path in ALLOWED_SAFE_KEY_DISPLAY_CALL_FILES
42+
if path != Path("mapping_utils.py")
43+
)
44+
expected_modules = sorted(
45+
[*expected_runtime_modules, *EXPECTED_SAFE_KEY_DISPLAY_EXTRA_IMPORTERS]
46+
)
47+
assert discovered_modules == expected_modules

0 commit comments

Comments
 (0)