import pytest from src.trader_mcp.server import app # Ensure src is a valid package import target in all runners. @pytest.fixture def client(): try: from fastapi.testclient import TestClient except Exception as e: # pragma: no cover pytest.skip(f"TestClient not available: {e}") return TestClient(app) def test_root(client): r = client.get("/") assert r.status_code == 200 assert r.json().get("status") == "ok" def test_health(client): r = client.get("/health") assert r.status_code == 200 assert r.json().get("status") == "ok" def test_dashboard(client): r = client.get("/dashboard/") assert r.status_code == 200 assert "Trader MCP Dashboard" in r.text