test_valid_json¶
Tests › tests/guard/test_guard_impact.py
What this test is for
Why it exists
The test says nothing about why.
Given
entries = [ ImpactEntry( req_id="REQ-0001", functions=[ChangedFunction(name="F", file_path="a.c", new_version="1.0")], ), ]
When
result = format_json(entries)data = json.loads(result)["entries"]
Then
- ✓ len(data) equals 1
- ✓ data[0]["req_id"] equals "REQ-0001"
tests/guard/test_guard_impact.py:317 · its file's page
What it checks (2)
assert len(data) == 1not attributedassert data[0]["req_id"] == "REQ-0001"not attributed
Where the product reaches it
main→_run→run_precommit→_write_report→format_json(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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-GUARD-010 measured