"""Tests for connection tools (connect, disconnect, status)."""

import pytest
from conftest import parse_result
from fastmcp import Client


@pytest.mark.anyio
async def test_status_shows_connected(mcp_client: Client):
    result = await mcp_client.call_tool("status", {})
    data = parse_result(result)
    assert data["connected"] is True
    assert data["demo_mode"] is True
    assert data["firmware"] == "g2"


@pytest.mark.anyio
async def test_connect_demo_noop(mcp_client: Client):
    result = await mcp_client.call_tool("connect", {})
    data = parse_result(result)
    assert data["mode"] == "demo"
    assert data["status"] == "connected"


@pytest.mark.anyio
async def test_disconnect_demo_noop(mcp_client: Client):
    result = await mcp_client.call_tool("disconnect", {})
    data = parse_result(result)
    assert data["status"] == "demo"
