Add birdcage-mcp FastMCP server for satellite dish control
34 tools (connection, movement, signal, system, satellite, console), 5 resources, 3 prompts. Backed by DemoDevice for offline testing. 46 tests passing against the demo backend via run_server_async.
This commit is contained in:
parent
16ca4892b3
commit
8a6b99bd8c
21 changed files with 3233 additions and 0 deletions
80
mcp/tests/test_signal.py
Normal file
80
mcp/tests/test_signal.py
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
"""Tests for signal measurement tools."""
|
||||
|
||||
import pytest
|
||||
from conftest import parse_result
|
||||
from fastmcp import Client
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_rssi_default(mcp_client: Client):
|
||||
result = await mcp_client.call_tool("get_rssi", {})
|
||||
data = parse_result(result)
|
||||
assert data["reads"] == 10
|
||||
assert isinstance(data["average"], int)
|
||||
assert isinstance(data["current"], int)
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_rssi_custom_iterations(mcp_client: Client):
|
||||
result = await mcp_client.call_tool("get_rssi", {"iterations": 5})
|
||||
data = parse_result(result)
|
||||
assert data["reads"] == 5
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_adc_rssi(mcp_client: Client):
|
||||
result = await mcp_client.call_tool("get_adc_rssi", {})
|
||||
data = parse_result(result)
|
||||
assert "raw" in data
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_lock_status(mcp_client: Client):
|
||||
result = await mcp_client.call_tool("get_lock_status", {})
|
||||
data = parse_result(result)
|
||||
assert "raw" in data
|
||||
assert "Lock:" in data["raw"]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_enable_lna(mcp_client: Client):
|
||||
result = await mcp_client.call_tool("enable_lna", {})
|
||||
data = parse_result(result)
|
||||
assert data["status"] == "lna_enabled"
|
||||
assert data["voltage"] == "13V"
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_dvb_config(mcp_client: Client):
|
||||
result = await mcp_client.call_tool("get_dvb_config", {})
|
||||
data = parse_result(result)
|
||||
assert "BCM" in data["raw"]
|
||||
assert "0x4515" in data["raw"]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_get_channel_params(mcp_client: Client):
|
||||
result = await mcp_client.call_tool("get_channel_params", {})
|
||||
data = parse_result(result)
|
||||
assert "Frequency" in data["raw"]
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_az_sweep(mcp_client: Client):
|
||||
result = await mcp_client.call_tool(
|
||||
"az_sweep",
|
||||
{
|
||||
"start_az": 195.0,
|
||||
"span": 10.0,
|
||||
"step_cdeg": 200,
|
||||
"num_xponders": 1,
|
||||
},
|
||||
)
|
||||
data = parse_result(result)
|
||||
assert data["count"] > 0
|
||||
assert len(data["points"]) == data["count"]
|
||||
pt = data["points"][0]
|
||||
assert "az" in pt
|
||||
assert "rssi" in pt
|
||||
assert "lock" in pt
|
||||
assert "snr" in pt
|
||||
Loading…
Add table
Add a link
Reference in a new issue