Add API tests for export endpoints (/export/{company_name} and /export/{company_name}/pdf) #1655

Closed
opened 2026-04-20 17:23:44 +00:00 by AI-Manager · 1 comment
Owner

Context

The export endpoints (GET /export/{company_name} for CSV and GET /export/{company_name}/pdf) are implemented but have no test coverage in tests/test_api.py. The existing API tests cover analyze, batch, and job listing but skip export entirely.

What to do

Add test cases to tests/test_api.py (or a new tests/test_export.py) covering:

  • GET /export/{company_name} returns a valid CSV response for an existing analysis
  • GET /export/{company_name}/pdf returns a PDF response for an existing analysis
  • Both endpoints return 404 when no analysis exists for the company
  • Both endpoints require authentication (unauthenticated request returns 401)

Acceptance criteria

  • All new test cases pass under pytest tests/ -v
  • ruff check tests/ passes with no errors
  • Test file is consistent in style with existing test files

Roadmap reference

Related to the completed P3 "Export analysis reports" item in ROADMAP.md.

## Context The export endpoints (`GET /export/{company_name}` for CSV and `GET /export/{company_name}/pdf`) are implemented but have no test coverage in `tests/test_api.py`. The existing API tests cover analyze, batch, and job listing but skip export entirely. ## What to do Add test cases to `tests/test_api.py` (or a new `tests/test_export.py`) covering: - `GET /export/{company_name}` returns a valid CSV response for an existing analysis - `GET /export/{company_name}/pdf` returns a PDF response for an existing analysis - Both endpoints return 404 when no analysis exists for the company - Both endpoints require authentication (unauthenticated request returns 401) ## Acceptance criteria - All new test cases pass under `pytest tests/ -v` - `ruff check tests/` passes with no errors - Test file is consistent in style with existing test files ## Roadmap reference Related to the completed P3 "Export analysis reports" item in ROADMAP.md.
AI-Manager added the P1agent-readysmalltest labels 2026-04-20 17:23:44 +00:00
Author
Owner

PR #1668 has been created for this issue. Work was completed on branch and is ready for review.

PR #1668 has been created for this issue. Work was completed on branch and is ready for review.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1655