test_python_definitions_are_recovered_with_class_qualification¶
Tests › tests/test_ast_symbols.py
What this test is for
Why it exists
WHY THIS EXISTS, having been refused for the life of the module. The harvester returned `{}` for every Python tree, on the stated ground that "doxygen indexes Python fully — a Doxyfile-less Python codebase measured 4,739 functions — so there is nothing to recover there".
Given
src = _PY_SOURCE.encode()tree = SubstrateParser("python").parse(src)
When
found = {f.name: f for f in harvest_python_definitions(tree, src)}all(f.static is False for f in found.values())
Then
- ✓ found contains "top_level_plain"
- ✓ found contains "top_level_decorated"
- ✓ found contains "method_one"
- ✓ found contains "method_two"
- ✓ found does not contain "closure_helper"
- ✓ found["method_one"].qualified equals "Holder.method_one"
- ✓ found["top_level_plain"].qualified equals "top_level_plain"
- ✓ all(f.static is False for f in found.values()) holds
tests/test_ast_symbols.py:976 · its file's page
What it checks (8)
assert "top_level_plain" in foundobservesharvest_python_definitionsviafoundassert "top_level_decorated" in found, "a decorated def must not be skipped"observesharvest_python_definitionsviafoundassert "method_one" in foundobservesharvest_python_definitionsviafoundassert "method_two" in found, "a @property is a decorated method"observesharvest_python_definitionsviafoundassert "closure_helper" not in found, "a nested def is a LOCAL, not a symbol"observesharvest_python_definitionsviafoundassert found["method_one"].qualified == "Holder.method_one"observesharvest_python_definitionsviafoundassert found["top_level_plain"].qualified == "top_level_plain"observesharvest_python_definitionsviafoundassert all(f.static is False for f in found.values())observesall
Where the product reaches it
dossier→_rank_enum_over_mirror→_class_side_is_only_enum_mirrors→all(flow)
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-PIPE-003 measured
- REQ-DDB-WIKI-054 inferred