test_gate_index_subset.py

tests/test_gate_index_subset.py

What the gate checks is a subset of what the index holds, by the owner's ruling.

test_the_gate_checks_mixin_members_and_stays_within_the_index

None test_gate_index_subset.test_the_gate_checks_mixin_members_and_stays_within_the_index()

The gate checks a mixin's members, and nothing the index does not hold.

tests/test_gate_index_subset.py:53

Checks

  • assert {"getFileUrl", "upload"} <= gate, gate
  • assert not {"inner", "run", "action"} & gate, gate
  • assert gate <= index, f"the gate checks what the index does not hold: {sorted(gate - index)}"

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-019measuredtest_the_gate_checks_mixin_members_and_stays_within_the_index → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags
REQ-DDB-GUARD-020measuredtest_the_gate_checks_mixin_members_and_stays_within_the_index → parse_functions_ts
REQ-DDB-GUARD-021inferredtest_the_gate_checks_mixin_members_and_stays_within_the_index → parse_functions_ts → _collect_functions → _find_preceding_doxygen → _find_python_docstring_block
REQ-DDB-GUARD-024measuredtest_the_gate_checks_mixin_members_and_stays_within_the_index → parse_functions_ts → _collect_functions → _is_rust_test_item
REQ-DDB-GUARD-025measuredtest_the_gate_checks_mixin_members_and_stays_within_the_index → parse_functions_ts → _collect_functions → _js_returns_void
REQ-DDB-PIPE-012measured
Source · 19 lines
def test_the_gate_checks_mixin_members_and_stays_within_the_index() -> None:
    """THREE CLAIMS: the gate now sees `getFileUrl` and `upload`; it does NOT see the closure
    `inner`, the signature `run`, or the object function `action` (owner's ruling); and every name
    it sees is a definition the index holds.

    @brief Gate ⊆ index, and the gate covers mixin members.
    @return None.
    @version 1
    """
    gate = {f.name for f in parse_functions_ts(_SRC, "typescript")}
    index = {
        f["name"]
        for f in harvest_definitions(lps.parse_tree("typescript", _SRC.encode()), _SRC.encode())[
            "functions"
        ]
    }
    assert {"getFileUrl", "upload"} <= gate, gate
    assert not {"inner", "run", "action"} & gate, gate
    assert gate <= index, f"the gate checks what the index does not hold: {sorted(gate - index)}"

1 more lines, not shown

Activity · 5 steps
lines 62–62gate = {f.name for f in parse_functions_ts(_SRC, "typescript")}lines 63–68index = { f["name"] for f in harvest_definitions(lps.parse_tree("typescript", _SRC.encode()), _SRC.encode())[ "functions" ] }lines 69–69assert {"getFileUrl", "upload"} <= gate, gatelines 70–70assert not {"inner", "run", "action"} & gate, gatelines 71–71assert gate <= index, f"the gate checks what the index does not hold: {sorted(gate - index)}"