test_a_family_spanning_both_sides_is_first_party¶
Tests › tests/test_diagnostics.py
What this test is for
Why it exists
THE STATED RULE FOR AN EXPRESSIBLE AMBIGUITY. A prefix can collect functions from both a repo and its submodule, and then the classification could silently pick either side. Fail-closed here means OURS — the same asymmetry `scope._is_dependency_of_parent` and `locks._origin_per_mutex` argue: if any part of the family is this repo's, declaring a prefix IS an action the operator can take, and calling it external would remove it from the list they act on.
Given
db = _attributed_corpus( tmp_path / "clew.db", [("function", f"Store_Set_{key}", 1) for key in ("A", "B")] + [("function", f"Store_Set_{key}", 2) for key in ("C", "D")], [(1, "src/store.c", None), (2, "extern/dep/store_extra.c", "extern/dep")], )
When
meta = dg.collect(db, tmp_path / "absent.Doxyfile", None, None, None).as_meta()
Then
- ✓ meta["accessor_families_first_party_count"] equals "1"
- ✓ meta["accessor_families_external_count"] equals "0"
- ✓ meta["accessor_families"] contains "Store_Set_* (4 keys)"
tests/test_diagnostics.py:160 · its file's page
What it checks (3)
assert meta["accessor_families_first_party_count"] == "1"observescollectviametaassert meta["accessor_families_external_count"] == "0"observescollectviametaassert "Store_Set_* (4 keys)" in meta["accessor_families"], ( "all four keys count toward the family; only its ORIGIN is at issue" )observescollectviameta
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 7 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-QUERY-011 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured