Finished take-home test #81
Open
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.
schemas.py - fixed a bug
name had type set to integer (changed to string)
test_pet.py - improvements
Parameterized to test all statuses: ["available", "sold", "pending"]
Validates response code is 200
Validates each pet's status matches the query
Validates schema for each pet in response
Proper error handling for validation failures
test_get_by_id_404 - improvements
Comprehensive parameterization with 7 test cases
All return 404 as expected
Clear error messages for debugging
test_patch_order_by_id:
Creates order for testing
Tests PATCH with status update to "sold"
Validates 200 response
Validates success message: "Order and pet status updated successfully"
Verifies pet status sync: Pet status changes to "sold"
setup_order fixture:
Uses @pytest.fixture as suggested
Finds available pet automatically
Handles edge case: Skips if no available pets
Reusable for multiple tests
test_patch_order_with_fixture:
Uses fixture for test data
Tests all statuses: ["pending", "sold", "available"]
Validates 200 response for each
Validates success message for each