"""Tests for mctelnet server.""" import pytest from mctelnet.server import _connections, mcp def test_mcp_server_exists(): """Verify MCP server is configured.""" assert mcp.name == "mctelnet" def test_tools_registered(): """Verify all expected tools are registered.""" # Access tools through the tool manager's internal storage tool_manager = mcp._tool_manager tool_names = set(tool_manager._tools.keys()) expected_tools = { "connect", "send", "read", "expect", "expect_send", "run_script", "list_connections", "disconnect", "disconnect_all", } assert expected_tools.issubset(tool_names), f"Missing tools: {expected_tools - tool_names}" def test_connection_storage_initially_empty(): """Verify no connections exist at startup.""" # Clear any lingering connections _connections.clear() assert len(_connections) == 0