test_mattermost_tree.py

tests/integration/test_mattermost_tree.py

The TypeScript/JSX acceptance target, asserted on its REAL tree.

test_only_the_emoji_table_is_self_declared_generated

None test_mattermost_tree.test_only_the_emoji_table_is_self_declared_generated(Path mattermost_db)

The one generated file is recorded, by its exact path, and no namesake is.

tests/integration/test_mattermost_tree.py:104

Checks

  • assert paths == {"app/utils/emoji/index.ts"}, paths
  • assert generation_rule(conn, "app/components/navigation_header/index.tsx") is None

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-QUERY-003measuredtest_only_the_emoji_table_is_self_declared_generated → generation_rule → table_exists
REQ-DDB-QUERY-004measuredtest_only_the_emoji_table_is_self_declared_generated → generation_rule
Source · 19 lines
def test_only_the_emoji_table_is_self_declared_generated(mattermost_db: Path) -> None:
    """MEASURED: one file in this tree declares itself generated, `app/utils/emoji/index.ts`. Its
    basename is the most common in the repository, so a basename join would mark hundreds of
    hand-written files generated; this asserts the exact-path rule holds at that scale.

    @brief The exact-path rule holds on the real tree.
    @version 1
    """
    conn = sqlite3.connect(mattermost_db)
    paths = {
        r[0]
        for r in conn.execute(
            "SELECT output_literal FROM generated_files WHERE kind LIKE 'self-declared:%'"
        )
    }
    assert paths == {"app/utils/emoji/index.ts"}, paths
    assert generation_rule(conn, "app/components/navigation_header/index.tsx") is None

Activity · 4 steps
lines 112–112conn = sqlite3.connect(mattermost_db)lines 113–118paths = { r[0] for r in conn.execute( "SELECT output_literal FROM generated_files WHERE kind LIKE 'self-declared:%'" ) }lines 119–119assert paths == {"app/utils/emoji/index.ts"}, pathslines 120–120assert generation_rule(conn, "app/components/navigation_header/index.tsx") is None

test_the_websocket_dispatcher_calls_the_reaction_handler

None test_mattermost_tree.test_the_websocket_dispatcher_calls_the_reaction_handler(Path mattermost_db)

The websocket dispatcher is recorded as the caller of Q2's handler.

tests/integration/test_mattermost_tree.py:127

Show on the map →

Called by none

Calls callers

Checks

  • assert "handleWebSocketEvent" in names, names

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-QUERY-001measuredtest_the_websocket_dispatcher_calls_the_reaction_handler → callers
REQ-DDB-QUERY-003measuredtest_the_websocket_dispatcher_calls_the_reaction_handler → callers → _call_edges → _dataflow_edges → resolve_rowid
REQ-DDB-QUERY-009measuredtest_the_websocket_dispatcher_calls_the_reaction_handler → callers → _call_edges → _direct_call_edges → _implementors_by_identity
REQ-DDB-QUERY-010measuredtest_the_websocket_dispatcher_calls_the_reaction_handler → callers
Source · 9 lines
def test_the_websocket_dispatcher_calls_the_reaction_handler(mattermost_db: Path) -> None:
    """The first hop of Q2's flow, across files: `handleWebSocketEvent` (actions/websocket/event.ts)
    calls `handleReactionAddedToPostEvent` (actions/websocket/reactions.ts).

    @brief Q2's first hop is an edge.
    @version 1
    """
    names = {edge.name for edge in callers(mattermost_db, "handleReactionAddedToPostEvent")}
    assert "handleWebSocketEvent" in names, names

1 more lines, not shown

Activity · 2 steps
lines 134–134names = {edge.name for edge in callers(mattermost_db, "handleReactionAddedToPostEvent")}lines 135–135assert "handleWebSocketEvent" in names, names