Luigi's picture
Organize project structure: move test scripts to tests/scripts and documentation to docs/reports
d28c36c
"""
Test script for the MCP server
"""
import asyncio
import sys
import os
# Add the web directory to the path so we can import the mcp_server module
sys.path.insert(0, os.path.join(os.path.dirname(__file__)))
def test_fastmcp_import():
"""Test that we can import the FastMCP class."""
try:
from mcp.server import FastMCP
print("โœ“ Successfully imported FastMCP")
return True
except Exception as e:
print(f"โœ— Failed to import FastMCP: {e}")
return False
def test_imports():
"""Test that we can import the MCP server module."""
try:
# We need to mock the app import since it's not available in this context
import app
from mcp_server import RTSGameMCP
print("โœ“ Successfully imported RTSGameMCP")
return True
except Exception as e:
print(f"โœ— Failed to import RTSGameMCP: {e}")
return False
if __name__ == "__main__":
print("Testing MCP server imports...")
tests = [
test_fastmcp_import
# test_imports # Skip this for now since it depends on the app module
]
results = []
for test in tests:
results.append(test())
if all(results):
print("\nโœ“ All tests passed!")
else:
print("\nโœ— Some tests failed!")
sys.exit(1)