Skip to main content
Glama

Mnemosyne MCP

by MumuTW
test_search_service.py2 kB
""" 搜索服務單元測試 """ # 簡化的測試,避免複雜的導入問題 class TestSearchService: """搜索服務測試類別""" def test_basic_functionality(self): """基本功能測試""" # 簡單的測試確保測試框架工作 assert True def test_content_extraction(self): """測試內容提取邏輯""" # 模擬內容提取邏輯 def extract_content_from_node(node_data): content_fields = ["name", "path", "signature", "docstring", "content"] for field in content_fields: if field in node_data and node_data[field]: return str(node_data[field]) return "No content available" # 測試不同的內容欄位 test_cases = [ ({"name": "test_name"}, "test_name"), ({"path": "test/path.py"}, "test/path.py"), ({"signature": "def test():"}, "def test():"), ({"docstring": "Test docstring"}, "Test docstring"), ({"content": "File content"}, "File content"), ({}, "No content available"), ] for node_data, expected in test_cases: result = extract_content_from_node(node_data) assert result == expected def test_risk_level_determination(self): """測試風險等級確定邏輯""" def determine_risk_level(risk_score): if risk_score >= 0.8: return "CRITICAL" elif risk_score >= 0.6: return "HIGH" elif risk_score >= 0.3: return "MEDIUM" else: return "LOW" # 測試不同風險分數對應的等級 test_cases = [ (0.1, "LOW"), (0.4, "MEDIUM"), (0.7, "HIGH"), (0.9, "CRITICAL"), ] for score, expected_level in test_cases: result = determine_risk_level(score) assert result == expected_level

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/MumuTW/Mnemosyne-mcp'

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