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, gateassert not {"inner", "run", "action"} & gate, gateassert gate <= index, f"the gate checks what the index does not hold: {sorted(gate - index)}"
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-019 | measured | test_the_gate_checks_mixin_members_and_stays_within_the_index → parse_functions_ts → _collect_functions → _find_preceding_doxygen → parse_doxygen_tags |
| REQ-DDB-GUARD-020 | measured | test_the_gate_checks_mixin_members_and_stays_within_the_index → parse_functions_ts |
| REQ-DDB-GUARD-021 | inferred | test_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-024 | measured | test_the_gate_checks_mixin_members_and_stays_within_the_index → parse_functions_ts → _collect_functions → _is_rust_test_item |
| REQ-DDB-GUARD-025 | measured | test_the_gate_checks_mixin_members_and_stays_within_the_index → parse_functions_ts → _collect_functions → _js_returns_void |
| REQ-DDB-PIPE-012 | measured |
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