Add SKYWALKER_MOCK=1 mode for hardware-free MCP integration testing

Extract MockSkyWalker1 to shared mock_device.py (used by both unit tests
and server lifespan). Server checks SKYWALKER_MOCK env var at startup —
when set, uses mock device instead of USB hardware, enabling full MCP
transport testing via claude -p without the dongle connected.

Verified: 64 unit tests pass, claude -p integration tests exercise
identify_frequency, get_device_status, and sweep_spectrum through the
complete JSON-RPC pipeline.
This commit is contained in:
Ryan Malloy 2026-02-17 15:23:05 -07:00
parent 4a63dbbb9d
commit cbfbbf6bfe
4 changed files with 150 additions and 133 deletions

View file

@ -87,7 +87,7 @@ def test_prompt_count():
async def test_get_device_status(ctx):
result = await get_device_status(ctx)
assert "3.05.0-test" in result["firmware"]["version"]
assert "3.05.0" in result["firmware"]["version"]
assert result["usb_speed"] == "High (480 Mbps)"
assert "de ad be ef" in result["serial"]