test_python_definitions_are_recovered_with_class_qualification

Tests › tests/test_ast_symbols.py

passed Passed in the packaged run.

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

  1. src = _PY_SOURCE.encode()
  2. tree = SubstrateParser("python").parse(src)
→

When

  1. found = {f.name: f for f in harvest_python_definitions(tree, src)}
  2. all(f.static is False for f in found.values())
→

Then

  1. ✓ found contains "top_level_plain"
  2. ✓ found contains "top_level_decorated"
  3. ✓ found contains "method_one"
  4. ✓ found contains "method_two"
  5. ✓ found does not contain "closure_helper"
  6. ✓ found["method_one"].qualified equals "Holder.method_one"
  7. ✓ found["top_level_plain"].qualified equals "top_level_plain"
  8. ✓ 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)

  1. assert "top_level_plain" in found observes harvest_python_definitions via found
  2. assert "top_level_decorated" in found, "a decorated def must not be skipped" observes harvest_python_definitions via found
  3. assert "method_one" in found observes harvest_python_definitions via found
  4. assert "method_two" in found, "a @property is a decorated method" observes harvest_python_definitions via found
  5. assert "closure_helper" not in found, "a nested def is a LOCAL, not a symbol" observes harvest_python_definitions via found
  6. assert found["method_one"].qualified == "Holder.method_one" observes harvest_python_definitions via found
  7. assert found["top_level_plain"].qualified == "top_level_plain" observes harvest_python_definitions via found
  8. assert all(f.static is False for f in found.values()) observes all

Where the product reaches it

  • dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all (flow)

Call flow

test_python_definitions_are_recovered_with_class_qualification→harvest_python_definitions→all

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_python_definitions_are_recovered_with_class_qualification · 8 checksharvest_python_definitionsREQ-DDB-PIPE-003 · measuredallREQ-DDB-WIKI-054 · inferred
Also reaches 2 requirements

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