File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -149,9 +149,19 @@ def test_send_destination(ford_car):
149149
150150def test_service_history (ford_car ):
151151 response = ford_car .service_history ("2023-05-20" , "2024-02-10" )
152- assert response .status == "success"
153- assert isinstance (response , types .ServiceHistory )
154- assert response ._fields == ("status" , "message" , "meta" )
152+ assert isinstance (response , types .ServiceHistory ), "Response should be an instance of ServiceHistory"
153+ assert hasattr (response , '_fields' ), "Response should have '_fields' attribute"
154+ assert 'items' in response ._fields , "'items' should be a key in the response fields"
155+
156+ # Check the 'items' array.
157+ assert isinstance (response .items , list ), "Items should be a list"
158+
159+ # Iterate over each item in the 'items' list to perform further validations.
160+ for item in response .items :
161+ assert isinstance (item ['odometerDistance' ], float ), "Odometer distance should be a float"
162+ assert item ['odometerDistance' ] > 0 , "Odometer distance should be greater than zero"
163+
164+ assert response ._fields == ("items" , "meta" )
155165
156166
157167def test_batch_success (chevy_volt ):
You can’t perform that action at this time.
0 commit comments