test(8249): area groups, first pass: one file folded in, three readout checks merged, two copies removed
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 2m23s
CI & Build / integration (push) Successful in 2m25s
CI & Build / Build & push image (push) Successful in 19s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 13s
CI & Build / TypeScript typecheck (push) Successful in 33s
CI & Build / Python tests (push) Successful in 2m23s
CI & Build / integration (push) Successful in 2m25s
CI & Build / Build & push image (push) Successful in 19s
- test_mcp_tool_tasks_kind.py is folded into test_mcp_tool_tasks.py, the tool's own file: the two "kind passes through" cases are one table, the two list-filter cases one table; the minted_kind refusals move to the service's kind tests (test_services_notes_task_kind.py). - A fresh install reads as empty, not failed: three database tests each ran retrieval_summary on an empty install and checked one block (usage, judged, system_usage). One test now checks all three. - test_reply_shapes::test_the_tool_is_registered_as_a_read: everything it checked, test_moments::test_the_tools_are_registered_and_classified checks. - test_shape_ledger::test_classify_and_list_are_mounted_as_mcp_tools: every classified tool name must be a registered tool (test_mcp_auth::test_every_registered_tool_is_classified_exactly_once). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ from grimoire.mcp.tools.tasks import (
|
||||
list_tasks, get_task, create_task,
|
||||
update_task, add_task_log,
|
||||
)
|
||||
from tests.helpers import fake_task
|
||||
from tests.helpers import fake_note, fake_task
|
||||
|
||||
|
||||
pytestmark = pytest.mark.usefixtures("_bind_user")
|
||||
@@ -271,3 +271,50 @@ async def test_add_task_log_propagates_value_error_when_task_missing():
|
||||
):
|
||||
with pytest.raises(ValueError):
|
||||
await add_task_log(task_id=999, content="x")
|
||||
|
||||
|
||||
# ── kind: the door passes it through, and "" leaves it alone ─────────────
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize("kind", ["issue", "spike"])
|
||||
async def test_create_task_passes_the_kind_through(kind):
|
||||
"""`spike` is the kind a failed rule-check asks for: time-boxed, and its
|
||||
output is knowledge rather than a change, so filing one as `work` makes a
|
||||
finished investigation look like an abandoned change."""
|
||||
mock = AsyncMock(return_value=fake_note(task_kind=kind))
|
||||
with patch("grimoire.mcp.tools.tasks.notes_svc.create_note", mock):
|
||||
await create_task(title="Can the runner be given a bash shell?", kind=kind)
|
||||
assert mock.call_args.kwargs["task_kind"] == kind
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize("given,sent", [({"kind": "issue"}, "issue"), ({}, None)])
|
||||
async def test_list_tasks_filters_by_kind_only_when_asked(given, sent):
|
||||
mock = AsyncMock(return_value=([], 0))
|
||||
with patch("grimoire.mcp.tools.tasks.notes_svc.list_notes", mock):
|
||||
await list_tasks(**given)
|
||||
assert mock.call_args.kwargs["task_kind"] == sent
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_update_task_can_re_file_a_kind():
|
||||
"""A task's kind must be CORRECTABLE, not write-once.
|
||||
|
||||
What a piece of work turns out to be is often clear only once it is under
|
||||
way. Without a `kind` parameter on `update_task`, and with a REST route that
|
||||
drops the field the editor sends, the save reports success and reverts on
|
||||
reload.
|
||||
"""
|
||||
mock = AsyncMock(return_value=fake_note(task_kind="spike"))
|
||||
with patch("grimoire.mcp.tools.tasks.notes_svc.update_note", mock):
|
||||
await update_task(task_id=1, kind="spike")
|
||||
assert mock.call_args.kwargs["task_kind"] == "spike"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_update_task_leaves_kind_alone_when_not_given():
|
||||
""""" means leave unchanged, as it does for every other field here."""
|
||||
mock = AsyncMock(return_value=fake_note())
|
||||
with patch("grimoire.mcp.tools.tasks.notes_svc.update_note", mock):
|
||||
await update_task(task_id=1, title="renamed")
|
||||
assert "task_kind" not in mock.call_args.kwargs
|
||||
|
||||
Reference in New Issue
Block a user