test_the_change_lens_exists_only_with_an_impact_report

Tests › tests/test_wiki_web.py

passed Passed in the packaged run.

What this test is for

Why it exists

NO IMPACT REPORT, NO CHANGE LENS (ported from the box map, which the web replaced): with a report the lens exists and a changed function carries `changed`.

Given

  1. —
→

When

  1. plain = build_graph(db, [], None, _DECLARED, exclude_tests=True)
  2. web_html(web_data(db, plain))
  3. web_data(db, plain)
4 more
  1. impact = [{"req_id": "R-1", "functions": [{"name": "save", "file": "pkg/core/store.py"}]}]
  2. measured = build_graph(db, [], impact, _DECLARED, exclude_tests=True)
  3. data = web_data(db, measured)
  4. web_html(data)
→

Then

  1. ✓ web_html(web_data(db, plain)) does not contain "Change</option>"
  2. ✓ web_html(data) contains "Change</option>"
  3. ✓ {n["name"]: n.get("changed") for n in data["nodes"]}["save"] is True

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.

Build this wiki from the index · 21 of 400 steps

… 140 earlier steps

callercallercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyother filesother filesother filesother filesother filesloop (line 204)looploop (line 206)loopopt (line 373)optloop (line 373)looploop (line 282)looploop (line 207)looptry (line 209)trybuild_wiki141. parse_contexts → _context_test141_context_test142. _build_site → build_graph142build_graph143. build_graph → connect143connect▶ test enters144. build_graph → _tested_calls144_tested_calls145. _tested_calls → table_exists145table_exists146. build_graph → _links146_links147. _links → table_exists147table_exists148. _links → _bump148_bump149. _links → table_exists149table_exists150. _links → 150… 1 call not run151. build_graph → _threads151_threads152. _threads → table_exists152table_exists153. build_graph → _vendor_calls_in153_vendor_calls_in154. _vendor_calls_in → table_exists154table_exists155. _vendor_calls_in → is_vendor155is_vendor156–164. build_graph → _components156_components +8 more165. _build_site → flow_page165flow_page166. flow_page → _executed166_executed

… 234 later steps

tests/test_wiki_web.py:130 · its file's page

What it checks (3)

  1. assert "Change</option>" not in web_html(web_data(db, plain)) observes web_html
  2. assert "Change</option>" in web_html(data) observes web_html
  3. assert {n["name"]: n.get("changed") for n in data["nodes"]}["save"] is True observes web_data via data

Where the product reaches it

  • build_wiki → _build_site → build_graph (flow)

Call flow

test_the_change_lens_exists_only_with_an_impact_report→build_graph→web_html→web_data

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_change_lens_exists_only_with_an_impact_report · 3 checksbuild_graphconnectREQ-DDB-QUERY-001 · measuredbuild_graph_linkstable_existsREQ-DDB-QUERY-003 · measuredbuild_graphREQ-DDB-WIKI-019 · measuredweb_htmlREQ-DDB-WIKI-021 · measuredweb_data_index_requirementsREQ-DDB-WIKI-022 · measured
Also reaches 5 requirements

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