test_a_macro_accessor_family_is_named_in_the_payload¶
Tests › tests/test_diagnostics.py
What this test is for
Why it exists
Macros only, deliberately: the case the diagnostic exists for is a repo whose accessors produce ZERO function rows, so a fixture with a function in it would pass against a functions-only corpus and prove nothing.
Given
db = _corpus( tmp_path / "clew.db", [("macro definition", f"Store_Set_{key}") for key in ("A", "B", "C", "D", "E")], )
When
result = dg.collect(db, tmp_path / "absent.Doxyfile", None, None, None)meta = result.as_meta()
Then
- ✓ (result.accessor_families[0].prefix, result.accessor_families[0].keys) equals ( "Store_Set_", 5, )
- ✓ meta["accessor_families"] contains "Store_Set_* (5 keys)"
- ✓ meta["accessor_families_count"] equals "1"
- ✓ meta["accessor_names_examined"] equals "5"
- ✓ meta["accessor_families_first_party_count"] equals "1"
- ✓ meta["accessor_families_external_count"] equals "0"
tests/test_diagnostics.py:221 · its file's page
What it checks (6)
assert (result.accessor_families[0].prefix, result.accessor_families[0].keys) == ( "Store_Set_", 5, )observescollectviaresultassert "Store_Set_* (5 keys)" in meta["accessor_families"]not attributedassert meta["accessor_families_count"] == "1"not attributedassert meta["accessor_names_examined"] == "5"not attributedassert meta["accessor_families_first_party_count"] == "1"not attributedassert meta["accessor_families_external_count"] == "0"not attributed
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