test_valid_json

Tests › tests/guard/test_guard_impact.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Given

  1. entries = [ ImpactEntry( req_id="REQ-0001", functions=[ChangedFunction(name="F", file_path="a.c", new_version="1.0")], ), ]
→

When

  1. result = format_json(entries)
  2. data = json.loads(result)["entries"]
→

Then

  1. ✓ len(data) equals 1
  2. ✓ data[0]["req_id"] equals "REQ-0001"

tests/guard/test_guard_impact.py:317 · its file's page

What it checks (2)

  1. assert len(data) == 1 not attributed
  2. assert data[0]["req_id"] == "REQ-0001" not attributed

Where the product reaches it

  • main → _run → run_precommit → _write_report → format_json (flow)

Call flow

test_valid_json→format_json

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_valid_json · 2 checksformat_jsonREQ-DDB-GUARD-010 · measured
Also reaches 1 requirement

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