Skip to content

Commit 77c45a9

Browse files
Add architecture guard for shared plain-list helper usage
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 4426f30 commit 77c45a9

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ This runs lint, format checks, compile checks, tests, and package build.
9292
- `tests/test_mapping_keys_access_usage.py` (centralized key-iteration boundaries),
9393
- `tests/test_mapping_reader_usage.py` (shared mapping-read parser usage),
9494
- `tests/test_optional_serialization_helper_usage.py` (optional model serialization helper usage enforcement),
95+
- `tests/test_plain_list_helper_usage.py` (shared plain-list normalization helper usage enforcement),
9596
- `tests/test_plain_type_guard_usage.py` (`str`/`int` guardrail enforcement via plain-type checks),
9697
- `tests/test_plain_type_identity_usage.py` (direct `type(... ) is str|int` guardrail enforcement via shared helpers),
9798
- `tests/test_polling_loop_usage.py` (`while True` polling-loop centralization in `hyperbrowser/client/polling.py`),

tests/test_architecture_marker_usage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"tests/test_architecture_marker_usage.py",
1919
"tests/test_plain_type_guard_usage.py",
2020
"tests/test_plain_type_identity_usage.py",
21+
"tests/test_plain_list_helper_usage.py",
2122
"tests/test_optional_serialization_helper_usage.py",
2223
"tests/test_type_utils_usage.py",
2324
"tests/test_polling_loop_usage.py",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
pytestmark = pytest.mark.architecture
6+
7+
8+
MODULES = (
9+
"hyperbrowser/client/managers/extension_utils.py",
10+
"hyperbrowser/client/managers/session_utils.py",
11+
)
12+
13+
14+
def test_extension_and_session_utils_use_shared_plain_list_helper():
15+
for module_path in MODULES:
16+
module_text = Path(module_path).read_text(encoding="utf-8")
17+
assert "read_plain_list_items(" in module_text
18+
assert "type(extensions_value) is not list" not in module_text
19+
assert "type(response_data) is not list" not in module_text

0 commit comments

Comments
 (0)