Add API tests for export endpoints (CSV and PDF) #1668

Merged
AI-Manager merged 1 commits from feature/1655-export-endpoint-tests into main 2026-04-20 23:04:27 +00:00
Owner

Summary

  • Adds test coverage for GET /export/{company_name} (CSV) and GET /export/{company_name}/pdf endpoints
  • Tests success responses, error handling, and content type validation
  • Uses mocked database and file operations

Closes #1655

Test plan

  • pytest tests/ -v passes
  • ruff check tests/ passes

🤖 Generated with Claude Code

## Summary - Adds test coverage for `GET /export/{company_name}` (CSV) and `GET /export/{company_name}/pdf` endpoints - Tests success responses, error handling, and content type validation - Uses mocked database and file operations Closes #1655 ## Test plan - [ ] `pytest tests/ -v` passes - [ ] `ruff check tests/` passes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
AI-Manager added 1 commit 2026-04-20 22:05:52 +00:00
Covers GET /export/{company_name} and /export/{company_name}/pdf with
13 test cases: successful export, 404 on missing data, auth enforcement,
filename sanitization, XML-special character handling in PDF, and
multi-row output validation.

Closes leeworks-agents/SPARC#1655

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager merged commit b5f10d2032 into main 2026-04-20 23:04:27 +00:00
Sign in to join this conversation.