test_the_tree_is_composed_transitively_and_namespaced

Tests › tests/test_wiki_composite.py

passed Passed in the packaged run.

What this test is for

Why it exists

PRD-001 <- lib:REQ-LIB-001 <- hal:REQ-HAL-001; PRD-002 has no satisfier.

Given

  1. product, pins = _fixture(tmp_path)
→

When

  1. tree = compose(product, "product", _specs(product, pins), probe=_no_index)
→

Then

  1. ✓ tree.roots equals ("product:REQ-PRD-001", "product:REQ-PRD-002")
  2. ✓ tree.nodes["product:REQ-PRD-001"].satisfied_by equals ("lib:REQ-LIB-001",)
  3. ✓ tree.nodes["lib:REQ-LIB-001"].satisfied_by equals ("hal:REQ-HAL-001",)
  4. ✓ tree.nodes["product:REQ-PRD-002"].satisfied_by equals ()
  5. ✓ tree.nodes["hal:REQ-HAL-001"].pin equals pins["hal"]

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) · 7 of 357 steps

… 62 earlier steps

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.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 267)looptry (line 269)tryopt (line 1336)optalt (line 1344)alttry (line 1352)tryloop (line 973)looploop (line 974)looploop (line 287)looploop (line 288)loopmain63. load_external_requirements → get_requirements63get_requirements64. load_external_requirements → read_catalog_at64read_catalog_at65. read_catalog_at → _refuse_url65_refuse_url▶ test enters66–69. read_catalog_at → git_text66git_text +3 more70. read_catalog_at → _refuse_url70_refuse_url71. read_catalog_at → _catalog_rows71_catalog_rows72. _validate_files → get_requirements72get_requirements73. _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

4 more

tests/test_wiki_composite.py:94 · its file's page

What it checks (5)

  1. assert tree.roots == ("product:REQ-PRD-001", "product:REQ-PRD-002") observes compose via tree
  2. assert tree.nodes["product:REQ-PRD-001"].satisfied_by == ("lib:REQ-LIB-001",) observes compose via tree
  3. assert tree.nodes["lib:REQ-LIB-001"].satisfied_by == ("hal:REQ-HAL-001",) observes compose via tree
  4. assert tree.nodes["product:REQ-PRD-002"].satisfied_by == () observes compose via tree
  5. assert tree.nodes["hal:REQ-HAL-001"].pin == pins["hal"] observes compose via tree

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_the_tree_is_composed_transitively_and_namespaced→_fixture→compose→_specs

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_the_tree_is_composed_transitively_and_namespaced · 5 checkscompose_root_sourcedeclared_catalogload_guard_configREQ-DDB-CONFIG-001 · measuredcompose_root_sourcedeclared_catalog_is_flat_req_listREQ-DDB-CONFIG-003 · measuredcompose… 4 calls …read_requirements_sectionREQ-DDB-GUARD-012 · inferredcompose… 5 calls …apply_opt_in_languagesREQ-DDB-GUARD-024 · inferredcompose_walk_nested_specsgit_textREQ-DDB-GUARD-027 · measuredcompose_root_sourcedeclared_catalogresolve_catalog_pathREQ-DDB-SCHEMA-006 · measuredcompose_nodeslink_idsREQ-DDB-SCHEMA-015 · measuredcompose_root_sourcedeclared_catalogREQ-DDB-WIKI-015 · measuredcomposeREQ-DDB-WIKI-040 · measuredcompose… 3 calls …allREQ-DDB-WIKI-054 · inferred
Also reaches 10 requirements

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