test_a_field_doxygen_already_emitted_is_not_duplicated¶
Tests › tests/test_python_class_fields.py
What this test is for
Why it exists
The harvest deliberately collects EVERY annotated field, including the ones doxygen emitted, because which are present is a fact about the database rather than the source. The dedup therefore has to happen here, against the existing links — and if it does not, a class ends up with two rows for one attribute, which is gh#19's defect reintroduced through the back door.
Given
conn = _index()conn.execute( "INSERT INTO memberdef (rowid, name, type, kind, file_id, line) " "VALUES (99, 'brief', 'str', 'variable', 1, 9)" )
2 more
conn.execute("INSERT INTO member (scope_rowid, memberdef_rowid, prot, virt) VALUES (10,99,0,0)")harvested = [ (1, {"class_fields": [["brief", "Config", "str", 9], ["name", "Config", "str", 7]]}) ]
When
_recover_class_fields_into(conn, harvested)
Then
- ✓ _recover_class_fields_into(conn, harvested) equals 1
- ✓ _members(conn, "a::Config") equals [("brief", "str", "doxygen"), ("name", "str", "ast")]
tests/test_python_class_fields.py:214 · its file's page
What it checks (2)
assert _recover_class_fields_into(conn, harvested) == 1, "only the missing one is inserted"observes_recover_class_fields_intoassert _members(conn, "a::Config") == [("brief", "str", "doxygen"), ("name", "str", "ast")]observes_members
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 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-004 measured
- REQ-DDB-WIKI-054 inferred