We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/seanerama/cisco-commerce-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
test_server.py•1.96 kB
"""Tests for the MCP server tools."""
import pytest
from cisco_catalog_mcp.constants import ITEM_ATTRIBUTES, PRICE_LISTS
from cisco_catalog_mcp.server import list_available_attributes, list_price_lists
class TestUtilityTools:
"""Tests for utility tools that don't require API calls."""
def test_list_price_lists(self) -> None:
"""Test list_price_lists returns correct data."""
result = list_price_lists()
assert result == PRICE_LISTS
assert "GLUS" in result
assert result["GLUS"]["currency"] == "USD"
def test_list_available_attributes(self) -> None:
"""Test list_available_attributes returns all attributes."""
result = list_available_attributes()
assert result == ITEM_ATTRIBUTES
assert "ListPrice" in result
assert "ProductType" in result
assert len(result) > 50 # Should have 65+ attributes
# Integration tests would go here - these require actual credentials
# and are marked to skip unless explicitly enabled
@pytest.mark.skip(reason="Integration test - requires Cisco API credentials")
class TestIntegration:
"""Integration tests that require real API credentials."""
@pytest.mark.asyncio
async def test_lookup_pricing_real(self) -> None:
"""Test actual API call for pricing lookup."""
from cisco_catalog_mcp.server import lookup_pricing
results = await lookup_pricing(["C9300-24T-E"])
assert len(results) == 1
assert results[0]["sku"] == "C9300-24T-E"
assert "list_price" in results[0]
@pytest.mark.asyncio
async def test_get_product_details_real(self) -> None:
"""Test actual API call for product details."""
from cisco_catalog_mcp.server import get_product_details
result = await get_product_details("C9300-24T-E")
assert result["sku"] == "C9300-24T-E"
assert "description" in result
assert "list_price" in result