Skip to content

Conversation

@dvanaria
Copy link

@dvanaria dvanaria commented Jan 8, 2026

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant