This commit is contained in:
2026-03-31 11:38:32 +08:00
commit 5ca759d280
17 changed files with 2171 additions and 0 deletions

24
tests/test_server.py Normal file
View File

@@ -0,0 +1,24 @@
"""测试 MCP Server"""
import pytest
from njupt_mcp.server import mcp
@pytest.mark.asyncio
async def test_search_course():
"""测试课程搜索工具"""
from njupt_mcp.server import search_course
result = await search_course("数据结构", limit=2)
assert "CS2101" in result
assert "数据结构" in result
@pytest.mark.asyncio
async def test_get_campus_info():
"""测试校园信息工具"""
from njupt_mcp.server import get_campus_info
result = await get_campus_info("overview")
assert "南京邮电大学" in result
assert "NJUPT" in result