This topic provides guidance on unit and integration tests that validate enrichment logic, formatting, and configuration behavior.

Unit testing for enrichment logic

The following unit tests verify generation logic and formatting edge cases:
  • tests/unit/test_openapi_enrich.py
  • tests/unit/test_openapi_per_tool_context.py
These tests ensure that filter examples, parameter examples, and per-tool context are generated correctly and handle edge cases such as truncation and newline preservation.

Integration testing for context management

The tests/integration/test_per_tool_context_integration.py integration test validates end-to-end behavior for per-tool context enrichment. This test covers:
  • Priority sorting
  • Truncation behavior
  • Maximum file limits
  • Disabled feature flags
  • Ignoring unsupported per-operation formatting keys