test_an_unread_key_is_kept_and_named

Tests › tests/test_requirement_fields.py

passed Passed in the packaged run.

What this test is for

Why it exists

`risk` and `x-owner` are kept in `extra`, and the log names them.

Given

  1. row = _row(tmp_path, caplog)
→

When

  1. —
→

Then

  1. ✓ json.loads(row["extra"]) equals {"risk": "high", "x-owner": "platform"}
  2. ✓ caplog.text contains "risk"
  3. ✓ caplog.text contains "x-owner"

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

`main` (clew/guard/main.py) · 1 of 357 steps

… 72 earlier steps

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyother filesother filesother filesother filesloop (line 973)looploop (line 974)looploop (line 287)looploop (line 288)loopmain73. _validate_files → check_satisfies73check_satisfies74. check_satisfies → link_ids74link_ids75. link_ids → satisfies_ids75satisfies_ids▶ test enters76. _validate_files → load_failure_mode_ids76load_failure_mode_ids77. load_failure_mode_ids → _get_requirements_config77_get_requirements_config

… 280 later steps

tests/test_requirement_fields.py:60 · its file's page

What it checks (2)

  1. assert json.loads(row["extra"]) == {"risk": "high", "x-owner": "platform"} observes _row via row
  2. assert "risk" in caplog.text and "x-owner" in caplog.text not attributed

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_an_unread_key_is_kept_and_named→_row

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_an_unread_key_is_kept_and_named · 2 checks_rowingest_requirements_yamlresolve_catalog_columnsREQ-DDB-CONFIG-001 · measured_rowingest_requirements_yaml_is_flat_req_listREQ-DDB-CONFIG-003 · measured_rowingest_requirements_yamlREQ-DDB-SCHEMA-006 · measured_rowingest_requirements_yamlREQ-DDB-SCHEMA-015 · measured_rowingest_requirements_yaml_is_flat_req_listallREQ-DDB-WIKI-054 · inferred
Also reaches 5 requirements

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