migration
This commit is contained in:
@@ -6,41 +6,10 @@ import pytest
|
||||
|
||||
pytestmark = pytest.mark.smoke
|
||||
|
||||
RETIRED_TOOL_NAMES = {
|
||||
"search_patterns",
|
||||
"get_pattern_by_id",
|
||||
"get_skill_document_by_id",
|
||||
}
|
||||
|
||||
|
||||
class TestMcpSkillsSurface:
|
||||
"""Covers native skill resources over the HTTP MCP surface."""
|
||||
|
||||
class TestTools:
|
||||
"""Covers generic resource fallback tools for native skills."""
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_lists_resource_fallback_tools(self, mcp_session_factory) -> None:
|
||||
"""Ensures generic resource tools replace skill-specific catalog tools."""
|
||||
async with mcp_session_factory() as mcp_session:
|
||||
result = await mcp_session.list_tools()
|
||||
tool_names = {tool.name for tool in result.tools}
|
||||
|
||||
assert {"list_resources", "read_resource"}.issubset(tool_names)
|
||||
assert RETIRED_TOOL_NAMES.isdisjoint(tool_names)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_reads_skill_through_fallback_tool(self, mcp_session_factory) -> None:
|
||||
"""Ensures tool-only clients can read a native skill resource."""
|
||||
async with mcp_session_factory() as mcp_session:
|
||||
result = await mcp_session.call_tool(
|
||||
"read_resource",
|
||||
{"uri": "skill://mcp-details/SKILL.md"},
|
||||
)
|
||||
|
||||
assert result.isError is False
|
||||
assert result.content
|
||||
|
||||
class TestResources:
|
||||
"""Covers native skill resources, manifests, and file templates."""
|
||||
|
||||
@@ -53,17 +22,15 @@ class TestMcpSkillsSurface:
|
||||
|
||||
assert "skill://mcp-details/SKILL.md" in resource_uris
|
||||
assert "skill://mcp-details/_manifest" in resource_uris
|
||||
assert "resource://catalog/skills_index" not in resource_uris
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_lists_resource_templates(self, mcp_session_factory) -> None:
|
||||
"""Ensures supporting files use per-skill wildcard templates."""
|
||||
async with mcp_session_factory() as mcp_session:
|
||||
result = await mcp_session.list_resource_templates()
|
||||
template_uris = {template.uriTemplate for template in result.resourceTemplates}
|
||||
template_uris = {template.uri_template for template in result.resource_templates}
|
||||
|
||||
assert "skill://mcp-details/{path*}" in template_uris
|
||||
assert "resource://skills/{skill_id}/document" not in template_uris
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_reads_manifest_and_supporting_file(self, mcp_session_factory) -> None:
|
||||
|
||||
Reference in New Issue
Block a user