test(deck): address PR #872 round-2 review
- Assert the open card stays visible under status="open" in the deck_get_stack integration test (completes the partition check). - Move the _append_archived_cards docstring closing quotes to their own line. deck_get_stack's status="archived" + include_cards=False path is left as-is: a single get_stack call is the cheapest way to obtain the stack metadata there — routing it through the archived fast-path would fetch every archived stack on the board just to strip the cards, which is heavier, not lighter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
90494674d9
commit
76779b3474
@@ -242,7 +242,8 @@ def _append_archived_cards(stack: DeckStack, extra: list[DeckCard]) -> None:
|
||||
"""Append archived cards onto a stack's existing card list, in place.
|
||||
|
||||
Kept separate so the assignment stays correctly typed against
|
||||
``DeckStack.cards`` (``list[DeckCard | DeckCardSummary] | None``)."""
|
||||
``DeckStack.cards`` (``list[DeckCard | DeckCardSummary] | None``).
|
||||
"""
|
||||
merged: list[DeckCard | DeckCardSummary] = list(stack.cards or [])
|
||||
merged.extend(extra)
|
||||
stack.cards = merged
|
||||
|
||||
@@ -505,7 +505,9 @@ async def test_deck_get_stack_status_includes_archived_mcp(
|
||||
payload = json.loads(result.content[0].text)
|
||||
return [c["id"] for c in (payload.get("cards") or [])]
|
||||
|
||||
assert archived_id not in await stack_card_ids("open")
|
||||
open_ids = await stack_card_ids("open")
|
||||
assert card_data["id"] in open_ids, "open card must stay visible under 'open'"
|
||||
assert archived_id not in open_ids
|
||||
assert archived_id in await stack_card_ids("all")
|
||||
assert await stack_card_ids("archived") == [archived_id]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user