test_running_the_recovery_twice_inserts_nothing_the_second_time¶
Tests › tests/test_python_class_fields.py
What this test is for
Why it exists
A refresh folds the whole cached payload set, so this stage sees every field on every build. Without the dedup reading back what it just wrote, each refresh would add another row per attribute and a class's member list would grow with the repository's build history.
Given
conn = _index()harvested = [(1, {"class_fields": [["name", "Config", "str", 7]]})]
When
_recover_class_fields_into(conn, harvested)
Then
- ✓ _recover_class_fields_into(conn, harvested) equals 1
- ✓ _recover_class_fields_into(conn, harvested) equals 0
- ✓ len(_members(conn, "a::Config")) equals 1
tests/test_python_class_fields.py:259 · its file's page
What it checks (3)
assert _recover_class_fields_into(conn, harvested) == 1observes_recover_class_fields_intoassert _recover_class_fields_into(conn, harvested) == 0observes_recover_class_fields_intoassert len(_members(conn, "a::Config")) == 1observes_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
test_running_the_recovery_twice_inserts_nothing_the_second_time→_index→_recover_class_fields_into→_membersWhat 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