Test basic swarm listing commands.
()
| 67 | send_cmd(f"destroy_session:{session_id}") |
| 68 | |
| 69 | def test_basic_swarm_commands(): |
| 70 | """Test basic swarm listing commands.""" |
| 71 | print("\n=== Testing Basic Swarm Commands ===") |
| 72 | |
| 73 | tests = [ |
| 74 | ("swarm:list", "List all swarms"), |
| 75 | ("swarm:members", "List all members"), |
| 76 | ("swarm:coordinators", "List coordinators"), |
| 77 | ("swarm:plans", "List plans"), |
| 78 | ("swarm:context", "List shared context"), |
| 79 | ("swarm:touches", "List file touches"), |
| 80 | ("swarm:conflicts", "List conflicts"), |
| 81 | ("swarm:interrupts", "List interrupts"), |
| 82 | ("swarm:proposals", "List proposals"), |
| 83 | ] |
| 84 | |
| 85 | passed = 0 |
| 86 | failed = 0 |
| 87 | |
| 88 | for cmd, desc in tests: |
| 89 | ok, output = send_cmd(cmd) |
| 90 | if ok: |
| 91 | print(f" ✓ {cmd}: {desc}") |
| 92 | # Verify output is valid JSON |
| 93 | try: |
| 94 | parsed = json.loads(output) if output and output.strip() not in ['', '{}'] else output |
| 95 | passed += 1 |
| 96 | except json.JSONDecodeError: |
| 97 | # Some outputs might be plain strings |
| 98 | passed += 1 |
| 99 | else: |
| 100 | print(f" ✗ {cmd}: {desc} - FAILED: {output[:100]}") |
| 101 | failed += 1 |
| 102 | |
| 103 | return passed, failed |
| 104 | |
| 105 | def test_swarm_touches_timestamps(): |
| 106 | """Test that file touches include timestamps.""" |
nothing calls this directly
no test coverage detected