test_an_explicit_manifest_file_outranks_a_declared_section¶
Tests › tests/test_tiers.py
What this test is for
Why it exists
Tier 1 beats tier 2, and the split is read from the SOURCE TYPE — `cli._declared_or_flag` hands back a Path for `--shared-key-patterns` and the parsed mapping for a declaration, so no second argument has to be kept in sync.
Given
manifest = tmp_path / "patterns.yaml"manifest.write_text(f"{KEY_ALIAS_FIELD}: ['FLAG_KEY_']\n", encoding="utf-8")
When
resolved = resolve_key_alias_prefixes(manifest, {KEY_ALIAS_FIELD: ["DECL_KEY_"]})
Then
- ✓ resolved.tier equals TIER_EXPLICIT
- ✓ set(resolved.values) equals {"FLAG_KEY_", "DECL_KEY_", *DEFAULT_KEY_ALIAS_PREFIXES}
tests/test_tiers.py:286 · its file's page
What it checks (2)
assert resolved.tier == TIER_EXPLICITobservesresolve_key_alias_prefixesviaresolvedassert set(resolved.values) == {"FLAG_KEY_", "DECL_KEY_", *DEFAULT_KEY_ALIAS_PREFIXES}, ( "tier 1 wins the TIER, but tier 2 is still a stated layer contributing values" )observesresolve_key_alias_prefixesviaresolved
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-SCHEMA-005 measured