From 76779b347497fbfcaba354f6d3418b3ee65f83f0 Mon Sep 17 00:00:00 2001 From: Chris Coutinho Date: Sun, 7 Jun 2026 18:25:56 +0200 Subject: [PATCH] test(deck): address PR #872 round-2 review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- nextcloud_mcp_server/server/deck.py | 3 ++- tests/server/test_deck_mcp.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nextcloud_mcp_server/server/deck.py b/nextcloud_mcp_server/server/deck.py index 19942c4a..2638f099 100644 --- a/nextcloud_mcp_server/server/deck.py +++ b/nextcloud_mcp_server/server/deck.py @@ -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 diff --git a/tests/server/test_deck_mcp.py b/tests/server/test_deck_mcp.py index 5800cbe5..30a2f337 100644 --- a/tests/server/test_deck_mcp.py +++ b/tests/server/test_deck_mcp.py @@ -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]