Skip to main content
Glama
QUICK_START.md3.26 kB
# Financial Endpoints Testing - Quick Start Guide ## TL;DR ```bash # Run all financial tests ./run_financial_tests.sh # Or with uv directly uv run pytest tests/unit/test_financial_errors.py tests/integration/test_financial_api.py -v --no-cov ``` ## What Was Implemented Comprehensive test coverage for `/financialReports` endpoint: - **16 tests** covering all error scenarios - **97.73% code coverage** on financial route - **Correlation ID validation** for all error responses - **Integration tests** for end-to-end flows ## Test Structure ``` tests/ ├── conftest.py # Shared fixtures ├── unit/ │ └── test_financial_errors.py # 10 error handling tests ├── integration/ │ └── test_financial_api.py # 6 integration tests ├── TEST_COVERAGE_SUMMARY.md # Detailed documentation └── QUICK_START.md # This file ``` ## Running Tests ### All Financial Tests ```bash uv run pytest tests/unit/test_financial_errors.py tests/integration/test_financial_api.py -v ``` ### Just Error Handling Tests ```bash uv run pytest tests/unit/test_financial_errors.py -v --no-cov ``` ### Just Integration Tests ```bash uv run pytest tests/integration/test_financial_api.py -v --no-cov ``` ### With Coverage Report ```bash uv run pytest tests/unit/test_financial_errors.py tests/integration/test_financial_api.py \ --cov=src/api/routes/financial \ --cov-report=term-missing \ --cov-report=html:htmlcov/financial ``` ### Single Test ```bash uv run pytest tests/unit/test_financial_errors.py::TestFinancialErrorHandling::test_correlation_id_format -v ``` ## What's Tested ### Error Scenarios (10 tests) - ✓ HTTP 500/404/403 errors with correlation IDs - ✓ Network timeouts and connection failures - ✓ Invalid date formats and ranges - ✓ Malformed JSON responses - ✓ Empty responses - ✓ Correlation ID format validation ### Success Scenarios (6 tests) - ✓ Account-wide financial reports - ✓ Property-specific financial reports - ✓ End-to-end flow testing - ✓ MCP protocol integration ## Coverage Results ``` Financial Route Coverage: 97.73% (43/44 statements) Tests Passing: 16/16 ✓ Test Execution Time: ~7 seconds ``` ## Key Files - **Tests**: `tests/unit/test_financial_errors.py`, `tests/integration/test_financial_api.py` - **Fixtures**: `tests/conftest.py` - **Implementation**: `src/api/routes/financial.py` - **Client**: `src/services/hostaway_client.py` - **Runner**: `./run_financial_tests.sh` ## Common Issues ### Issue: "Module src/api/routes/financial was never imported" **Solution**: This is a coverage warning, not a test failure. Tests still pass. ### Issue: Coverage shows 22% instead of 97% **Solution**: That's overall project coverage. Financial route coverage is 97.73%. ### Issue: RuntimeWarning about coroutine **Solution**: Minor async mock warning, doesn't affect test results. ## Next Steps 1. Run tests: `./run_financial_tests.sh` 2. Review coverage: `open htmlcov/financial/index.html` 3. Read details: `tests/TEST_COVERAGE_SUMMARY.md` 4. Check implementation: `TESTING_IMPLEMENTATION_SUMMARY.md` ## Support See `TESTING_IMPLEMENTATION_SUMMARY.md` for complete documentation.

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/darrentmorgan/hostaway-mcp'

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