test_a_declared_vocabulary_is_reported_and_reclassifies¶
Tests › tests/test_diagnostics.py
What this test is for
Why it exists
The loop gh#332 closes: an operator declares `event_tags`, and the reply has to say whether the declaration ARRIVED. A count alone cannot — it moves for several reasons.
Given
doxyfile = tmp_path / "Doxyfile"doxyfile.write_text(ALIASES_TEXT, encoding="utf-8")db = _corpus(tmp_path / "clew.db", [("function", "run")])
When
result = dg.collect(db, doxyfile, None, None, {"broadcasts": "producer"})meta = result.as_meta()
Then
- ✓ meta["event_vocabulary_source"] equals dg.SOURCE_DECLARED
- ✓ meta["event_vocabulary_size"] equals "1"
- ✓ result.unclaimed_aliases does not contain "broadcasts"
- ✓ result.unclaimed_aliases contains "emits"
tests/test_diagnostics.py:281 · its file's page
What it checks (4)
assert meta["event_vocabulary_source"] == dg.SOURCE_DECLAREDnot attributedassert meta["event_vocabulary_size"] == "1"not attributedassert "broadcasts" not in result.unclaimed_aliases, "the declared verb is claimed"observescollectviaresultassert "emits" in result.unclaimed_aliases, "a declaration REPLACES the built-in verbs"observescollectviaresult
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