test_a_macro_accessor_family_is_named_in_the_payload

Tests › tests/test_diagnostics.py

passed Passed in the packaged run.

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

  1. db = _corpus( tmp_path / "clew.db", [("macro definition", f"Store_Set_{key}") for key in ("A", "B", "C", "D", "E")], )
→

When

  1. result = dg.collect(db, tmp_path / "absent.Doxyfile", None, None, None)
  2. meta = result.as_meta()
→

Then

  1. ✓ (result.accessor_families[0].prefix, result.accessor_families[0].keys) equals ( "Store_Set_", 5, )
  2. ✓ meta["accessor_families"] contains "Store_Set_* (5 keys)"
  3. ✓ meta["accessor_families_count"] equals "1"
  4. ✓ meta["accessor_names_examined"] equals "5"
  5. ✓ meta["accessor_families_first_party_count"] equals "1"
  6. ✓ meta["accessor_families_external_count"] equals "0"

tests/test_diagnostics.py:221 · its file's page

What it checks (6)

  1. assert (result.accessor_families[0].prefix, result.accessor_families[0].keys) == ( "Store_Set_", 5, ) observes collect via result
  2. assert "Store_Set_* (5 keys)" in meta["accessor_families"] not attributed
  3. assert meta["accessor_families_count"] == "1" not attributed
  4. assert meta["accessor_names_examined"] == "5" not attributed
  5. assert meta["accessor_families_first_party_count"] == "1" not attributed
  6. assert 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

test_a_macro_accessor_family_is_named_in_the_payload→_corpus→collect

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.

test_a_macro_accessor_family_is_named_in_the_payload · 6 checkscollectresolve_shared_key_patternsREQ-DDB-CONFIG-006 · measuredcollectREQ-DDB-CONFIG-007 · measuredcollectload_thread_patternsREQ-DDB-SCHEMA-001 · measuredcollectresolve_shared_key_patternsREQ-DDB-SCHEMA-005 · measuredcollectload_lock_patternsREQ-DDB-SCHEMA-011 · measuredcollectload_lock_patternsdeclaration_originREQ-DDB-SCHEMA-012 · measured
Also reaches 7 requirements

Its run touches their code; that is reach, not proof.