a6162a855c
- pytest + respx + pytest-cov added as dev dependencies - tests/smoke/test_registration.py: verify all 66 tools registered and unique - tests/unit/: 12 files covering every tool — HTTP method, URL, params/body, errors - tests/config.test.json + conftest.py: zero-network test setup via GITEA_CONFIG - CLAUDE.md: developer guide with testing philosophy, pyramid, and commands - server/gitea_mcp.py: get_commit, list_pr_files tools added - README.md: tool count corrected to 66
28 lines
786 B
Python
28 lines
786 B
Python
import asyncio
|
|
from server.gitea_mcp import mcp
|
|
|
|
EXPECTED_TOOL_COUNT = 66
|
|
|
|
|
|
def test_all_tools_registered():
|
|
tools = asyncio.run(mcp.list_tools())
|
|
names = sorted(t.name for t in tools)
|
|
assert len(tools) == EXPECTED_TOOL_COUNT, (
|
|
f"Expected {EXPECTED_TOOL_COUNT} tools, found {len(tools)}.\n"
|
|
f"Tools: {names}"
|
|
)
|
|
|
|
|
|
def test_tool_names_unique():
|
|
tools = asyncio.run(mcp.list_tools())
|
|
names = [t.name for t in tools]
|
|
assert len(names) == len(set(names)), (
|
|
f"Duplicate tool names: {[n for n in names if names.count(n) > 1]}"
|
|
)
|
|
|
|
|
|
def test_all_tools_have_description():
|
|
tools = asyncio.run(mcp.list_tools())
|
|
missing = [t.name for t in tools if not t.description]
|
|
assert not missing, f"Tools without description: {missing}"
|