test_variable_selector.py

tests/test_variable_selector.py

`qualified` SELECTS ONE VARIABLE, OR SAYS IT DID NOT.

test_a_selector_naming_nothing_is_disclosed_not_silently_ignored

None test_variable_selector.test_a_selector_naming_nothing_is_disclosed_not_silently_ignored(Path spread)

The 1.4.0 defect: three different selectors, one identical reply, no word of why.

tests/test_variable_selector.py:89

Show on the map →

Called by none

Calls dossier

Checks

  • assert reply is not None and reply.variable is not None
  • assert len(reply.variable.sites) == 3
  • assert reply.variable.selector_note
  • assert "app.z.index.enhanced" in reply.variable.selector_note

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_a_selector_naming_nothing_is_disclosed_not_silently_ignored → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_a_selector_naming_nothing_is_disclosed_not_silently_ignored → dossier → connect
REQ-DDB-QUERY-002inferredtest_a_selector_naming_nothing_is_disclosed_not_silently_ignored → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_a_selector_naming_nothing_is_disclosed_not_silently_ignored → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_a_selector_naming_nothing_is_disclosed_not_silently_ignored → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-010measuredtest_a_selector_naming_nothing_is_disclosed_not_silently_ignored → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013inferredtest_a_selector_naming_nothing_is_disclosed_not_silently_ignored → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-WIKI-054inferredtest_a_selector_naming_nothing_is_disclosed_not_silently_ignored → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 7 lines
def test_a_selector_naming_nothing_is_disclosed_not_silently_ignored(spread: Path) -> None:
    """The 1.4.0 defect: three different selectors, one identical reply, no word of why."""
    reply = q.dossier(spread, "enhanced", qualified="app.z.index.enhanced")
    assert reply is not None and reply.variable is not None
    assert len(reply.variable.sites) == 3
    assert reply.variable.selector_note
    assert "app.z.index.enhanced" in reply.variable.selector_note

1 more lines, not shown

Activity · 5 steps
lines 91–91reply = q.dossier(spread, "enhanced", qualified="app.z.index.enhanced")lines 92–92assert reply is not None and reply.variable is not Nonelines 93–93assert len(reply.variable.sites) == 3lines 94–94assert reply.variable.selector_notelines 95–95assert "app.z.index.enhanced" in reply.variable.selector_note

test_a_selector_naming_one_declaration_narrows_the_sites

None test_variable_selector.test_a_selector_naming_one_declaration_narrows_the_sites(Path spread, str selector)

Exact, a unique suffix, or the other separator — the function path's selector rule.

tests/test_variable_selector.py:81

Show on the map →

Called by none

Calls dossier

Checks

  • assert reply is not None and reply.variable is not None
  • assert [s.file for s in reply.variable.sites] == ["app/b/index.ts"]
  • assert reply.variable.selector_note is None

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_a_selector_naming_one_declaration_narrows_the_sites → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_a_selector_naming_one_declaration_narrows_the_sites → dossier → connect
REQ-DDB-QUERY-002inferredtest_a_selector_naming_one_declaration_narrows_the_sites → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_a_selector_naming_one_declaration_narrows_the_sites → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_a_selector_naming_one_declaration_narrows_the_sites → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-010measuredtest_a_selector_naming_one_declaration_narrows_the_sites → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013inferredtest_a_selector_naming_one_declaration_narrows_the_sites → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-WIKI-054inferredtest_a_selector_naming_one_declaration_narrows_the_sites → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 8 lines
def test_a_selector_naming_one_declaration_narrows_the_sites(spread: Path, selector: str) -> None:
    """Exact, a unique suffix, or the other separator — the function path's selector rule."""
    reply = q.dossier(spread, "enhanced", qualified=selector)
    assert reply is not None and reply.variable is not None
    assert [s.file for s in reply.variable.sites] == ["app/b/index.ts"]
    assert reply.variable.selector_note is None

Activity · 4 steps
lines 83–83reply = q.dossier(spread, "enhanced", qualified=selector)lines 84–84assert reply is not None and reply.variable is not Nonelines 85–85assert [s.file for s in reply.variable.sites] == ["app/b/index.ts"]lines 86–86assert reply.variable.selector_note is None

test_without_a_selector_every_site_is_reported

None test_variable_selector.test_without_a_selector_every_site_is_reported(Path spread)

The unchanged default: a variable dossier names every declaration site.

tests/test_variable_selector.py:70

Show on the map →

Called by none

Calls dossier

Checks

  • assert reply is not None and reply.variable is not None
  • assert len(reply.variable.sites) == 3
  • assert reply.variable.selector_note is None

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-INDEX-004measuredtest_without_a_selector_every_site_is_reported → dossier → _chain_for → chain_trace → candidate_rows → symbol_provenance
REQ-DDB-QUERY-001measuredtest_without_a_selector_every_site_is_reported → dossier → connect
REQ-DDB-QUERY-002inferredtest_without_a_selector_every_site_is_reported → dossier → _chain_for → chain_trace
REQ-DDB-QUERY-003measuredtest_without_a_selector_every_site_is_reported → dossier → identity_rowids
REQ-DDB-QUERY-004measured
REQ-DDB-QUERY-005inferredtest_without_a_selector_every_site_is_reported → dossier → _chain_for → chain_trace → _make_node
REQ-DDB-QUERY-010measuredtest_without_a_selector_every_site_is_reported → dossier → identity_rowids
REQ-DDB-QUERY-012measured
REQ-DDB-QUERY-013measuredtest_without_a_selector_every_site_is_reported → dossier → _qualified_reread → _split_qualified → bare_tail
REQ-DDB-WIKI-054inferredtest_without_a_selector_every_site_is_reported → dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all
Source · 11 lines
def test_without_a_selector_every_site_is_reported(spread: Path) -> None:
    """The unchanged default: a variable dossier names every declaration site."""
    reply = q.dossier(spread, "enhanced")
    assert reply is not None and reply.variable is not None
    assert len(reply.variable.sites) == 3
    assert reply.variable.selector_note is None


@pytest.mark.parametrize(
    "selector", ["app.b.index.enhanced", "b.index.enhanced", "b::index::enhanced"]
)