Integration tests transform endpoint#229
Open
emmanuelmingo wants to merge 1 commit intoc2siorg:mainfrom
Open
Conversation
- Add test_transform_integration.py with 11 integration tests covering filter, sort, addRow, delRow, renameCol, invalid operation, and 404 - Fix conftest.py client fixture to patch alembic so tests run without PostgreSQL - Fix dataframe_to_response to accept optional page/pageSize with defaults so non-paginated callers are not broken - Fix get_project_details to default page=1, pageSize=100 so missing query params return data/404 instead of 422 All tests pass.
c0477db to
689f828
Compare
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.
Description
Adds integration tests for the
POST /projects/{id}/transformendpoint, verifying the full request-response cycle including request parsing, database interaction, file I/O, and response serialization.Also fixes several bugs uncovered during testing:
dataframe_to_responsemissing default values forpage/pageSize, breaking all non-paginated callersget_project_detailshad required query params with no defaults, returning 422 instead of 404 for deleted projectsclienttest fixture triggered alembic migrations against PostgreSQL on startup, breaking all HTTP-level testsFixes #91
Type of Change
How Has This Been Tested?
Added 11 pytest integration tests using FastAPI's
TestClientwith a real SQLite database and temporary CSV files. Each test gets a clean project state via fixtures.Tests cover:
Filter (equals, greater-than, missing params → 400)
Sort (ascending, descending)
Add row (row count increases)
Delete row (specific row removed)
Rename column (name updated in response)
Invalid operation type → 422
Nonexistent project → 404
Response shape validation
Existing tests pass
New tests added
Manual testing
Screenshots (if applicable)
N/A
Checklist