test_build_tooling_record.py

tests/test_build_tooling_record.py

WHICH PARSER BUILT THIS INDEX, recorded rather than inferred.

test_an_unrecorded_toolchain_leaves_no_row

None test_build_tooling_record.test_an_unrecorded_toolchain_leaves_no_row(Path tmp_path)

No `tool.*` row when nothing was measured.

tests/test_build_tooling_record.py:50

Show on the map →

Called by none

Calls _meta, write_build_signature

Checks

  • assert not [key for key in _meta(db) if key.startswith("tool.")]

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-006measuredtest_an_unrecorded_toolchain_leaves_no_row → write_build_signature
REQ-DDB-CONFIG-007measuredtest_an_unrecorded_toolchain_leaves_no_row → write_build_signature
REQ-DDB-PIPE-005measuredtest_an_unrecorded_toolchain_leaves_no_row → write_build_signature
Source · 14 lines
def test_an_unrecorded_toolchain_leaves_no_row(tmp_path: Path) -> None:
    """The falsy-drop rule, which every section here depends on: an absent key must read as
    "not recorded" rather than as a version that was read and was blank.

    @brief No `tool.*` row when nothing was measured. @version 1
    """
    db = tmp_path / "clew.db"
    sqlite3.connect(str(db)).close()

    write_build_signature(db, tool={"substrate_version": ""})

    assert not [key for key in _meta(db) if key.startswith("tool.")]

Activity · 4 steps
lines 56–56db = tmp_path / "clew.db"lines 57–57sqlite3.connect(str(db)).close()lines 59–59write_build_signature(db, tool={"substrate_version": ""})lines 61–61assert not [key for key in _meta(db) if key.startswith("tool.")]

test_the_tool_section_is_stamped_under_its_own_prefix

None test_build_tooling_record.test_the_tool_section_is_stamped_under_its_own_prefix(Path tmp_path)

A `tool` dict lands as `tool.*` rows.

tests/test_build_tooling_record.py:40

Show on the map →

Called by none

Calls _meta, write_build_signature

Checks

  • assert _meta(db)["tool.substrate_version"] == "0.11.2"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-006measuredtest_the_tool_section_is_stamped_under_its_own_prefix → write_build_signature
REQ-DDB-CONFIG-007measuredtest_the_tool_section_is_stamped_under_its_own_prefix → write_build_signature
REQ-DDB-PIPE-005measuredtest_the_tool_section_is_stamped_under_its_own_prefix → write_build_signature
Source · 10 lines
def test_the_tool_section_is_stamped_under_its_own_prefix(tmp_path: Path) -> None:
    """@brief A `tool` dict lands as `tool.*` rows. @version 1"""
    db = tmp_path / "clew.db"
    sqlite3.connect(str(db)).close()

    write_build_signature(db, tool={"substrate_version": "0.11.2"})

    assert _meta(db)["tool.substrate_version"] == "0.11.2"

Activity · 4 steps
lines 42–42db = tmp_path / "clew.db"lines 43–43sqlite3.connect(str(db)).close()lines 45–45write_build_signature(db, tool={"substrate_version": "0.11.2"})lines 47–47assert _meta(db)["tool.substrate_version"] == "0.11.2"