Skip to content

Commit 4eaa661

Browse files
feat: fixed e2e test assertions
1 parent 475d15c commit 4eaa661

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

tests/e2e/test_vehicle.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,19 @@ def test_send_destination(ford_car):
149149

150150
def 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

157167
def test_batch_success(chevy_volt):

0 commit comments

Comments
 (0)