Skip to main content
Glama

Hong Kong Creative Goods Trade MCP Server

by hkopenai
test_recreation_server.py1.38 kB
""" Module for testing the MCP server creation and tool registration. This module contains unit tests to verify the correct setup and behavior of the server. """ import unittest from unittest.mock import patch, Mock from hkopenai.hk_recreation_mcp_server.server import server class TestApp(unittest.TestCase): """ Test class for verifying MCP server creation and tool functionality. This class tests the initialization of the server and the registration of tools. """ @patch("hkopenai.hk_recreation_mcp_server.server.FastMCP") @patch("hkopenai.hk_recreation_mcp_server.tools.creative_goods_trade.register") def test_create_mcp_server(self, mock_tool_creative_goods_trade, mock_fastmcp): """Test the creation and configuration of the MCP server with mocked dependencies.""" # Setup mocks mock_server = Mock() # Configure mock_server.tool to return a mock that acts as the decorator # This mock will then be called with the function to be decorated mock_server.tool.return_value = Mock() mock_fastmcp.return_value = mock_server # Test server creation mcp_instance = server() # Verify server creation mock_fastmcp.assert_called_once() mock_tool_creative_goods_trade.assert_called_once_with(mock_server) if __name__ == "__main__": unittest.main()

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/hkopenai/hk-recreation-mcp-server'

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