Skip to main content
Glama
test_server.py1.5 kB
"""Basic tests for memvid MCP server.""" import pytest import asyncio from unittest.mock import Mock, patch import sys import os # Add the project root to the path sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) from memvid_mcp_server.main import ServerState, _check_memvid_available class TestServerState: """Test ServerState functionality.""" @pytest.mark.asyncio async def test_initialization(self): """Test server state initialization.""" state = ServerState() assert not state.initialized assert state.encoder is None assert state.retriever is None assert state.chat is None await state.initialize() assert state.initialized await state.cleanup() assert not state.initialized class TestMemvidAvailability: """Test memvid availability checking.""" def test_memvid_availability(self): """Test memvid availability check.""" # This will depend on whether memvid is actually installed result = _check_memvid_available() assert isinstance(result, bool) @pytest.mark.asyncio async def test_server_startup(): """Test that the server can start up without errors.""" from memvid_mcp_server.main import mcp # Basic smoke test - ensure the server object exists and has tools assert mcp is not None assert hasattr(mcp, '_tools') assert len(mcp._tools) > 0 if __name__ == "__main__": pytest.main([__file__])

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/angrysky56/memvid_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server