Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive unit tests for document-related API endpoints in the templafy package, establishing test coverage for core document operations including create, read, update, delete, list, and generate functionality.
- Adds unit tests for 6 document API endpoints with proper HTTP status code validation
- Introduces HTTPX mocking infrastructure with pytest-httpx dependency
- Creates shared test fixtures for document data and renames client fixture for clarity
Reviewed Changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/templafy/api/documents/test_create.py |
Tests document creation endpoint with file upload mock |
tests/templafy/api/documents/test_delete_by_id.py |
Tests document deletion endpoint expecting None on HTTP 204 |
tests/templafy/api/documents/test_generate.py |
Tests document generation endpoint with payload validation |
tests/templafy/api/documents/test_get_by_id.py |
Tests document retrieval by ID endpoint |
tests/templafy/api/documents/test_list_in_folder.py |
Tests listing documents in folder endpoint |
tests/templafy/api/documents/test_update.py |
Tests document update endpoint expecting None on HTTP 204 |
tests/conftest.py |
Renames client fixture and adds sample document test data |
pyproject.toml |
Adds pytest-httpx dependency for HTTP mocking |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

0 New Issues
0 Fixed Issues
0 Accepted Issues
No data about coverage (25.70% Estimated after merge)
This pull request introduces a comprehensive suite of tests for the document-related API endpoints in the
templafypackage. It also adds new test fixtures and updates dependencies to support HTTPX-based testing. The most important changes are grouped below by theme.Testing for Document API Endpoints:
tests/templafy/api/documents/test_create.py)Noneon successful deletion (HTTP 204). (tests/templafy/api/documents/test_delete_by_id.py)tests/templafy/api/documents/test_generate.py)tests/templafy/api/documents/test_get_by_id.py,tests/templafy/api/documents/test_list_in_folder.py) [1] [2]Noneon successful update (HTTP 204). (tests/templafy/api/documents/test_update.py)Test Infrastructure and Fixtures:
pytest-httpxdependency topyproject.tomlto enable HTTPX mocking in tests.tests/conftest.py) [1] [2]