Skip to content

Commit 8b905ed

Browse files
Add display blank-key literal boundary guard
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 71c5c04 commit 8b905ed

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ This runs lint, format checks, compile checks, tests, and package build.
119119
- `tests/test_core_type_helper_usage.py` (core transport/config/header/file/polling/session/error/parsing manager+tool module enforcement of shared plain-type helper usage),
120120
- `tests/test_default_serialization_helper_usage.py` (default optional-query serialization helper usage enforcement),
121121
- `tests/test_default_terminal_status_helper_usage.py` (default terminal-status helper usage enforcement for non-agent managers),
122+
- `tests/test_display_blank_key_literal_boundary.py` (blank-key display literal centralization in `hyperbrowser/display_utils.py`),
122123
- `tests/test_display_helper_usage.py` (display/key-format helper usage),
123124
- `tests/test_docs_python3_commands.py` (`README`/`CONTRIBUTING`/examples python3 command consistency enforcement),
124125
- `tests/test_example_run_instructions.py` (example run-instruction consistency enforcement),

tests/test_architecture_marker_usage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"tests/test_model_request_internal_reuse.py",
5050
"tests/test_model_request_wrapper_internal_reuse.py",
5151
"tests/test_tool_mapping_reader_usage.py",
52+
"tests/test_display_blank_key_literal_boundary.py",
5253
"tests/test_display_helper_usage.py",
5354
"tests/test_file_open_default_prefix_literal_boundary.py",
5455
"tests/test_file_message_default_constant_import_boundary.py",
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from pathlib import Path
2+
3+
import pytest
4+
5+
pytestmark = pytest.mark.architecture
6+
7+
8+
HYPERBROWSER_ROOT = Path(__file__).resolve().parents[1] / "hyperbrowser"
9+
ALLOWED_LITERAL_MODULE = Path("display_utils.py")
10+
BLANK_KEY_LITERAL = "<blank key>"
11+
12+
13+
def test_blank_key_literal_is_centralized_in_display_utils():
14+
violations: list[str] = []
15+
16+
for module_path in sorted(HYPERBROWSER_ROOT.rglob("*.py")):
17+
relative_path = module_path.relative_to(HYPERBROWSER_ROOT)
18+
if relative_path == ALLOWED_LITERAL_MODULE:
19+
continue
20+
module_text = module_path.read_text(encoding="utf-8")
21+
if BLANK_KEY_LITERAL not in module_text:
22+
continue
23+
violations.append(relative_path.as_posix())
24+
25+
assert violations == []

0 commit comments

Comments
 (0)