This project uses the pytest framework for testing, supporting both asynchronous testing and parameterized testing.
test_cbmcp.py - Main test file containing all MCP client functionality testspip install -e ".[dev]"
pytest tests/
# Run specific test file pytest tests/test_cbmcp.py # Run specific test class pytest tests/test_cbmcp.py::TestCloudberryMCPClient # Run specific test method pytest tests/test_cbmcp.py::TestCloudberryMCPClient::test_list_capabilities # Run tests for specific mode pytest tests/test_cbmcp.py -k "stdio"
pytest tests/ -v
pytest tests/ --cov=src.cbmcp --cov-report=html --cov-report=term
test_list_capabilities - Test tool, resource, and prompt listingstest_get_schemas_resource - Get database schemastest_get_tables_resource - Get table listingstest_get_database_info_resource - Get database informationtest_get_database_summary_resource - Get database summarytest_tools - Parameterized testing of all tool callstest_analyze_query_performance_prompt - Query performance analysis promptstest_suggest_indexes_prompt - Index suggestion promptstest_database_health_check_prompt - Database health check promptsTests support two modes:
You can use the provided script to run tests:
./run_tests.sh