Skip to content

Commit 78fa13d

Browse files
authored
Create test_e2e_user_flow.py
1 parent 43d2c9f commit 78fa13d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/e2e/test_e2e_user_flow.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
def test_create_and_get_carmakes(client):
3+
4+
get_response = client.get("/getallmakes?format=json")
5+
assert get_response.status_code == 200
6+
api_response = get_response.json()
7+
assert api_response['Message'] == "Response returned successfully"
8+
assert api_response['Results'][2]['Make_Name'] == '102 IRONWORKS, INC.' # Print first 100 results for brevity
9+
10+
11+
12+
def test_create_and_get_manufacturers(client):
13+
14+
get_response_get = client.get("/getallmanufacturers?format=json")
15+
assert get_response_get.status_code == 200
16+
api_response = get_response_get.json()
17+
assert api_response['Message'] == "Response returned successfully" # validate the message
18+
assert api_response['Results'][0]['Country'] in ["UNITED STATES (USA)", "JAPAN", "MEXICO"] # validate the country
19+
assert api_response['Results'][0]['VehicleTypes'] is not [] #validate the vehicle types are not empty
20+
21+

0 commit comments

Comments
 (0)