|
17 | 17 | pytestmark = pytest.mark.integration |
18 | 18 |
|
19 | 19 |
|
20 | | -# --------------------------------------------------------------------------- |
21 | | -# Helpers |
22 | | -# --------------------------------------------------------------------------- |
23 | | - |
24 | | - |
25 | 20 | async def _create_room(nc_mcp: McpTestHelper, name: str, room_type: int = 2) -> dict[str, Any]: |
26 | 21 | """Create a conversation and return the parsed result.""" |
27 | 22 | result = await nc_mcp.call("create_conversation", room_type=room_type, name=name) |
@@ -51,11 +46,6 @@ def _extract_message_id(line: str) -> int: |
51 | 46 | return int(match.group(1)) |
52 | 47 |
|
53 | 48 |
|
54 | | -# --------------------------------------------------------------------------- |
55 | | -# list_conversations |
56 | | -# --------------------------------------------------------------------------- |
57 | | - |
58 | | - |
59 | 49 | class TestListConversations: |
60 | 50 | @pytest.mark.asyncio |
61 | 51 | async def test_returns_json_list(self, nc_mcp: McpTestHelper) -> None: |
@@ -103,11 +93,6 @@ async def test_conversation_type_labels(self, nc_mcp: McpTestHelper) -> None: |
103 | 93 | await _delete_room(nc_mcp, str(public_room["token"])) |
104 | 94 |
|
105 | 95 |
|
106 | | -# --------------------------------------------------------------------------- |
107 | | -# get_conversation |
108 | | -# --------------------------------------------------------------------------- |
109 | | - |
110 | | - |
111 | 96 | class TestGetConversation: |
112 | 97 | @pytest.mark.asyncio |
113 | 98 | async def test_returns_conversation_details(self, nc_mcp: McpTestHelper) -> None: |
@@ -136,11 +121,6 @@ async def test_returns_read_only_status(self, nc_mcp: McpTestHelper) -> None: |
136 | 121 | await _delete_room(nc_mcp, str(room["token"])) |
137 | 122 |
|
138 | 123 |
|
139 | | -# --------------------------------------------------------------------------- |
140 | | -# get_messages (compact format) |
141 | | -# --------------------------------------------------------------------------- |
142 | | - |
143 | | - |
144 | 124 | class TestGetMessages: |
145 | 125 | @pytest.mark.asyncio |
146 | 126 | async def test_returns_compact_format(self, nc_mcp: McpTestHelper) -> None: |
@@ -283,11 +263,6 @@ async def test_compact_format_saves_space(self, nc_mcp: McpTestHelper) -> None: |
283 | 263 | await _delete_room(nc_mcp, str(room["token"])) |
284 | 264 |
|
285 | 265 |
|
286 | | -# --------------------------------------------------------------------------- |
287 | | -# get_participants |
288 | | -# --------------------------------------------------------------------------- |
289 | | - |
290 | | - |
291 | 266 | class TestGetParticipants: |
292 | 267 | @pytest.mark.asyncio |
293 | 268 | async def test_returns_participants_list(self, nc_mcp: McpTestHelper) -> None: |
@@ -330,11 +305,6 @@ async def test_nonexistent_conversation_raises(self, nc_mcp: McpTestHelper) -> N |
330 | 305 | await nc_mcp.call("get_participants", token="nonexistent-xyz-12345") |
331 | 306 |
|
332 | 307 |
|
333 | | -# --------------------------------------------------------------------------- |
334 | | -# send_message |
335 | | -# --------------------------------------------------------------------------- |
336 | | - |
337 | | - |
338 | 308 | class TestSendMessage: |
339 | 309 | @pytest.mark.asyncio |
340 | 310 | async def test_send_basic_message(self, nc_mcp: McpTestHelper) -> None: |
@@ -413,11 +383,6 @@ async def test_sent_message_appears_in_get_messages(self, nc_mcp: McpTestHelper) |
413 | 383 | await _delete_room(nc_mcp, str(room["token"])) |
414 | 384 |
|
415 | 385 |
|
416 | | -# --------------------------------------------------------------------------- |
417 | | -# create_conversation |
418 | | -# --------------------------------------------------------------------------- |
419 | | - |
420 | | - |
421 | 386 | class TestCreateConversation: |
422 | 387 | @pytest.mark.asyncio |
423 | 388 | async def test_create_group_conversation(self, nc_mcp: McpTestHelper) -> None: |
@@ -479,11 +444,6 @@ async def test_creator_is_participant(self, nc_mcp: McpTestHelper) -> None: |
479 | 444 | await _delete_room(nc_mcp, str(data["token"])) |
480 | 445 |
|
481 | 446 |
|
482 | | -# --------------------------------------------------------------------------- |
483 | | -# delete_message |
484 | | -# --------------------------------------------------------------------------- |
485 | | - |
486 | | - |
487 | 447 | class TestDeleteMessage: |
488 | 448 | @pytest.mark.asyncio |
489 | 449 | async def test_delete_own_message(self, nc_mcp: McpTestHelper) -> None: |
@@ -522,11 +482,6 @@ async def test_delete_in_nonexistent_conversation_raises(self, nc_mcp: McpTestHe |
522 | 482 | await nc_mcp.call("delete_message", token="nonexistent-xyz-12345", message_id=1) |
523 | 483 |
|
524 | 484 |
|
525 | | -# --------------------------------------------------------------------------- |
526 | | -# leave_conversation |
527 | | -# --------------------------------------------------------------------------- |
528 | | - |
529 | | - |
530 | 485 | class TestLeaveConversation: |
531 | 486 | @pytest.mark.asyncio |
532 | 487 | async def test_leave_group_conversation(self, nc_mcp: McpTestHelper) -> None: |
@@ -557,11 +512,6 @@ async def test_leave_nonexistent_conversation_raises(self, nc_mcp: McpTestHelper |
557 | 512 | await nc_mcp.call("leave_conversation", token="nonexistent-xyz-12345") |
558 | 513 |
|
559 | 514 |
|
560 | | -# --------------------------------------------------------------------------- |
561 | | -# Permission enforcement |
562 | | -# --------------------------------------------------------------------------- |
563 | | - |
564 | | - |
565 | 515 | class TestTalkPermissions: |
566 | 516 | @pytest.mark.asyncio |
567 | 517 | async def test_read_only_allows_list_conversations(self, nc_mcp_read_only: McpTestHelper) -> None: |
|
0 commit comments