File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import pytest
55
6+ from tests .test_display_helper_usage import ALLOWED_KEY_FORMAT_CALL_FILES
7+
68pytestmark = pytest .mark .architecture
79
810
9- EXPECTED_KEY_FORMAT_HELPER_IMPORTERS = (
10- "hyperbrowser/client/managers/extension_utils.py" ,
11- "hyperbrowser/client/managers/response_utils.py" ,
12- "hyperbrowser/client/managers/session_utils.py" ,
13- "hyperbrowser/tools/__init__.py" ,
14- "hyperbrowser/transport/base.py" ,
15- "tests/test_display_utils.py" ,
16- )
11+ EXPECTED_EXTRA_IMPORTERS = ("tests/test_display_utils.py" ,)
1712
1813
1914def _imports_format_string_key_for_error (module_text : str ) -> bool :
@@ -39,4 +34,10 @@ def test_format_string_key_for_error_imports_are_centralized():
3934 if _imports_format_string_key_for_error (module_text ):
4035 discovered_modules .append (module_path .as_posix ())
4136
42- assert discovered_modules == list (EXPECTED_KEY_FORMAT_HELPER_IMPORTERS )
37+ expected_modules = sorted (
38+ [
39+ * (f"hyperbrowser/{ path .as_posix ()} " for path in ALLOWED_KEY_FORMAT_CALL_FILES ),
40+ * EXPECTED_EXTRA_IMPORTERS ,
41+ ]
42+ )
43+ assert discovered_modules == expected_modules
Original file line number Diff line number Diff line change 33
44import pytest
55
6+ from tests .test_display_helper_usage import ALLOWED_NORMALIZE_DISPLAY_CALL_FILES
7+
68pytestmark = pytest .mark .architecture
79
810
9- EXPECTED_NORMALIZE_DISPLAY_IMPORTERS = (
10- "hyperbrowser/client/managers/response_utils.py" ,
11- "hyperbrowser/transport/base.py" ,
12- "tests/test_display_utils.py" ,
13- )
11+ EXPECTED_EXTRA_IMPORTERS = ("tests/test_display_utils.py" ,)
1412
1513
1614def _imports_normalize_display_text (module_text : str ) -> bool :
@@ -36,4 +34,10 @@ def test_normalize_display_text_imports_are_centralized():
3634 if _imports_normalize_display_text (module_text ):
3735 discovered_modules .append (module_path .as_posix ())
3836
39- assert discovered_modules == list (EXPECTED_NORMALIZE_DISPLAY_IMPORTERS )
37+ expected_runtime_modules = sorted (
38+ f"hyperbrowser/{ path .as_posix ()} "
39+ for path in ALLOWED_NORMALIZE_DISPLAY_CALL_FILES
40+ if path != Path ("display_utils.py" )
41+ )
42+ expected_modules = sorted ([* expected_runtime_modules , * EXPECTED_EXTRA_IMPORTERS ])
43+ assert discovered_modules == expected_modules
You can’t perform that action at this time.
0 commit comments