Skip to content

Commit 3130e5a

Browse files
jope-bmclaude
authored andcommitted
test: narrow tool results to str before splitlines
The tools return str | list[dict] depending on output_format; the new id-assertion tests called splitlines() without the isinstance narrowing the sibling tests use, failing ty in CI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Joe P <joe@basicmemory.com>
1 parent 18cb5eb commit 3130e5a

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

tests/mcp/test_tool_list_directory.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ async def test_list_directory_file_rows_include_external_id(client, test_graph,
234234

235235
result = await list_directory(project=test_project.name, dir_name="/test")
236236

237+
assert isinstance(result, str)
238+
237239
uuid_pattern = r"\| id: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}"
238240
file_lines = [line for line in result.splitlines() if line.startswith("📄")]
239241
assert file_lines, f"no file rows in: {result!r}"

tests/mcp/test_tool_recent_activity.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,8 @@ async def test_recent_activity_entity_rows_include_external_id(client, test_grap
624624

625625
result = await recent_activity(project=test_project.name, timeframe="30d")
626626

627+
assert isinstance(result, str)
628+
627629
assert "Recent Notes & Documents" in result
628630
uuid_pattern = r"\[id: [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\]"
629631
entity_lines = [line for line in result.splitlines() if line.strip().startswith("•")]

0 commit comments

Comments
 (0)