test_scope_alias.py¶
tests/test_scope_alias.py
`from-guard` names a tool that no longer exists, so `from-declaration` means the same thing.
test_an_unknown_scope_is_returned_for_the_caller_to_refuse
None test_scope_alias.test_an_unknown_scope_is_returned_for_the_caller_to_refuse()
An unrecognised value is passed through, not defaulted.
Checks
assert normalize_scope("whatever") == "whatever"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_an_unknown_scope_is_returned_for_the_caller_to_refuse → normalize_scope |
Source · 10 lines
def test_an_unknown_scope_is_returned_for_the_caller_to_refuse() -> None:
"""NORMALIZING IS NOT VALIDATING. The refusal for an unknown scope lives where the Doxyfile
is resolved and already names the two it accepts; silently mapping an unknown value onto a
default here would build a boundary the caller did not ask for and report success.
@brief An unrecognised value is passed through, not defaulted. @version 1
"""
assert normalize_scope("whatever") == "whatever"
Activity · 1 steps
test_every_existing_value_is_unchanged
None test_scope_alias.test_every_existing_value_is_unchanged(str|None value)
Existing values pass through untouched.
Checks
assert normalize_scope(value) == value
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_every_existing_value_is_unchanged → normalize_scope |
Source · 9 lines
def test_every_existing_value_is_unchanged(value: str | None) -> None:
"""THE COMPATIBILITY HALF. `from-guard` is written into `build_meta` and replayed by every
later build of that database, so the alias must not change what the recorded value means.
@brief Existing values pass through untouched. @version 1
"""
assert normalize_scope(value) == value
Activity · 1 steps
test_the_new_spelling_resolves_to_the_recorded_one
None test_scope_alias.test_the_new_spelling_resolves_to_the_recorded_one()
`from-declaration` normalizes to the stored value.
Checks
assert normalize_scope(SCOPE_FROM_DECLARATION) == SCOPE_FROM_GUARD
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-001 | measured | test_the_new_spelling_resolves_to_the_recorded_one → normalize_scope |
Source · 6 lines
def test_the_new_spelling_resolves_to_the_recorded_one() -> None:
"""@brief `from-declaration` normalizes to the stored value. @version 1"""
assert normalize_scope(SCOPE_FROM_DECLARATION) == SCOPE_FROM_GUARD
@pytest.mark.parametrize("value", [SCOPE_FROM_GUARD, SCOPE_DOXYFILE, None])