Skip to content

API Integration Tests

``` Create integrations tests for [feature] in [file path].

Context

  • Feature location: [file path]
  • Related services/dependencies: [repo, service]

Analysis Requirements

  1. Review testing standards from the testing cursor rules
  2. Study existing integration tests for patterns and conventions
  3. Analyze:
  4. Source code architecture
  5. Integration points
  6. External dependencies requiring mocks
  7. Data models and flows
  8. Existing test coverage

Implementation Guidelines

  1. Test Structure:
  2. Use Given-When-Then pattern with descriptive comments
  3. Focus on end-to-end workflows over isolated units
  4. Mock external dependencies appropriately

  5. Test Coverage:

  6. Core user scenarios and workflows
  7. Edge cases and error conditions
  8. Both happy and unhappy paths

  9. Quality Standards:

  10. Clear test descriptions
  11. Meaningful assertions
  12. Efficient test setup and teardown
  13. Appropriate use of test utilities and helpers @conftest.py
  14. Follow the project's test data management pattern in @test_data.py
  15. Do not define test data directly in test files

Constraints

  • Scope: Modify only the test file and test utilities / helpers
  • Format: Deliver complete, production-ready test code
  • Standards: Follow project's established testing patterns
  • Dependencies: Use existing test utilities and helpers

Output

Provide the complete test implementation in a single code block, following all project conventions and testing standards.