Skip to content

Commit 64ba087

Browse files
Add request-helper parse-import inventory synchronization guard
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent e1d976d commit 64ba087

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ This runs lint, format checks, compile checks, tests, and package build.
165165
- `tests/test_pyproject_architecture_marker.py` (pytest marker registration enforcement),
166166
- `tests/test_readme_examples_listing.py` (README example-listing consistency enforcement),
167167
- `tests/test_request_helper_parse_import_boundary.py` (request-helper import boundary enforcement for direct response parsing imports),
168+
- `tests/test_request_helper_parse_import_boundary_inventory.py` (request-helper parse-import boundary inventory synchronization enforcement),
168169
- `tests/test_request_helper_transport_boundary.py` (request-helper transport boundary enforcement through shared model request helpers),
169170
- `tests/test_request_wrapper_internal_reuse.py` (request-wrapper internal reuse of shared model request helpers across profile/team/extension/computer-action modules),
170171
- `tests/test_response_parse_usage_boundary.py` (centralized `parse_response_model(...)` usage boundary enforcement),

tests/test_architecture_marker_usage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"tests/test_contributing_architecture_guard_listing.py",
6464
"tests/test_readme_examples_listing.py",
6565
"tests/test_request_helper_parse_import_boundary.py",
66+
"tests/test_request_helper_parse_import_boundary_inventory.py",
6667
"tests/test_request_helper_transport_boundary.py",
6768
"tests/test_request_wrapper_internal_reuse.py",
6869
"tests/test_response_parse_usage_boundary.py",
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
from tests.test_request_helper_parse_import_boundary import REQUEST_HELPER_MODULES
6+
7+
pytestmark = pytest.mark.architecture
8+
9+
10+
EXPLICIT_AGENT_HELPER_MODULES = (
11+
"hyperbrowser/client/managers/agent_start_utils.py",
12+
"hyperbrowser/client/managers/agent_stop_utils.py",
13+
"hyperbrowser/client/managers/agent_task_read_utils.py",
14+
)
15+
16+
EXCLUDED_REQUEST_HELPER_MODULES = {
17+
"hyperbrowser/client/managers/model_request_utils.py",
18+
}
19+
20+
21+
def test_request_helper_parse_import_boundary_inventory_stays_in_sync():
22+
discovered_request_helper_modules = sorted(
23+
module_path.as_posix()
24+
for module_path in Path("hyperbrowser/client/managers").glob("*_request_utils.py")
25+
if module_path.as_posix() not in EXCLUDED_REQUEST_HELPER_MODULES
26+
)
27+
expected_modules = sorted(
28+
[
29+
*discovered_request_helper_modules,
30+
*EXPLICIT_AGENT_HELPER_MODULES,
31+
]
32+
)
33+
34+
assert sorted(REQUEST_HELPER_MODULES) == expected_modules

0 commit comments

Comments
 (0)