Skip to content

Commit

Permalink
test: updated failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
borolepratik committed Mar 4, 2024
1 parent 28debb4 commit 40312d5
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 47 deletions.
8 changes: 4 additions & 4 deletions tests/test_laps.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
client = TestClient(app)


# region laps - good inputs
# region good inputs


def test_get_laps():
Expand Down Expand Up @@ -164,9 +164,9 @@ def test_get_laps_with_session_and_driver_numbers():
}


# endregion laps - good inputs
# endregion good inputs

# region laps - bad inputs
# region bad inputs


def test_get_laps_mixed_driver_numbers():
Expand Down Expand Up @@ -217,4 +217,4 @@ def test_get_laps_bad_driver_numbers():
assert response.json() == []


# endregion laps - bad inputs
# endregion bad inputs
32 changes: 16 additions & 16 deletions tests/test_next_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ def test_get_next_event():
response = client.get("/next-event")
assert response.status_code == status.HTTP_200_OK
assert response.json() == {
"RoundNumber": 1,
"Country": "Bahrain",
"Location": "Sakhir",
"OfficialEventName": "FORMULA 1 GULF AIR BAHRAIN GRAND PRIX 2024",
"EventDate": "2024-03-02 00:00:00",
"EventName": "Bahrain Grand Prix",
"RoundNumber": 2,
"Country": "Saudi Arabia",
"Location": "Jeddah",
"OfficialEventName": "FORMULA 1 STC SAUDI ARABIAN GRAND PRIX 2024",
"EventDate": "2024-03-09 00:00:00",
"EventName": "Saudi Arabian Grand Prix",
"EventFormat": "conventional",
"Session1": "Practice 1",
"Session1Date": "2024-02-29 14:30:00+03:00",
"Session1DateUtc": "2024-02-29 11:30:00",
"Session1Date": "2024-03-07 16:30:00+03:00",
"Session1DateUtc": "2024-03-07 13:30:00",
"Session2": "Practice 2",
"Session2Date": "2024-02-29 18:00:00+03:00",
"Session2DateUtc": "2024-02-29 15:00:00",
"Session2Date": "2024-03-07 20:00:00+03:00",
"Session2DateUtc": "2024-03-07 17:00:00",
"Session3": "Practice 3",
"Session3Date": "2024-03-01 15:30:00+03:00",
"Session3DateUtc": "2024-03-01 12:30:00",
"Session3Date": "2024-03-08 16:30:00+03:00",
"Session3DateUtc": "2024-03-08 13:30:00",
"Session4": "Qualifying",
"Session4Date": "2024-03-01 19:00:00+03:00",
"Session4DateUtc": "2024-03-01 16:00:00",
"Session4Date": "2024-03-08 20:00:00+03:00",
"Session4DateUtc": "2024-03-08 17:00:00",
"Session5": "Race",
"Session5Date": "2024-03-02 18:00:00+03:00",
"Session5DateUtc": "2024-03-02 15:00:00",
"Session5Date": "2024-03-09 20:00:00+03:00",
"Session5DateUtc": "2024-03-09 17:00:00",
"F1ApiSupport": True,
}
8 changes: 4 additions & 4 deletions tests/test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
client = TestClient(app)


# region results - good inputs
# region good inputs


def test_get_results():
Expand Down Expand Up @@ -68,9 +68,9 @@ def test_get_results_with_session():
}


# endregion results - good inputs
# endregion good inputs

# region results - bad inputs
# region bad inputs


def test_get_results_bad_round_invalid():
Expand All @@ -79,4 +79,4 @@ def test_get_results_bad_round_invalid():
assert response.json() == {"detail": "Bad Request. Invalid round: 25"}


# endregion results - bad inputs
# endregion bad inputs
26 changes: 13 additions & 13 deletions tests/test_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,30 @@
def test_get_schedule():
response = client.get("/schedule")
assert response.status_code == status.HTTP_200_OK
assert response.json()["year"] == 2023
assert response.json()["year"] == 2024
assert response.json()["EventSchedule"][0] == {
"RoundNumber": 1,
"Country": "Bahrain",
"Location": "Sakhir",
"OfficialEventName": "FORMULA 1 GULF AIR BAHRAIN GRAND PRIX 2023",
"EventDate": "2023-03-05",
"OfficialEventName": "FORMULA 1 GULF AIR BAHRAIN GRAND PRIX 2024",
"EventDate": "2024-03-02",
"EventName": "Bahrain Grand Prix",
"EventFormat": "conventional",
"Session1": "Practice 1",
"Session1Date": "2023-03-03 14:30:00+03:00",
"Session1DateUtc": "2023-03-03 11:30:00",
"Session1Date": "2024-02-29 14:30:00+03:00",
"Session1DateUtc": "2024-02-29 11:30:00",
"Session2": "Practice 2",
"Session2Date": "2023-03-03 18:00:00+03:00",
"Session2DateUtc": "2023-03-03 15:00:00",
"Session2Date": "2024-02-29 18:00:00+03:00",
"Session2DateUtc": "2024-02-29 15:00:00",
"Session3": "Practice 3",
"Session3Date": "2023-03-04 14:30:00+03:00",
"Session3DateUtc": "2023-03-04 11:30:00",
"Session3Date": "2024-03-01 15:30:00+03:00",
"Session3DateUtc": "2024-03-01 12:30:00",
"Session4": "Qualifying",
"Session4Date": "2023-03-04 18:00:00+03:00",
"Session4DateUtc": "2023-03-04 15:00:00",
"Session4Date": "2024-03-01 19:00:00+03:00",
"Session4DateUtc": "2024-03-01 16:00:00",
"Session5": "Race",
"Session5Date": "2023-03-05 18:00:00+03:00",
"Session5DateUtc": "2023-03-05 15:00:00",
"Session5Date": "2024-03-02 18:00:00+03:00",
"Session5DateUtc": "2024-03-02 15:00:00",
"F1ApiSupport": True,
}

Expand Down
20 changes: 10 additions & 10 deletions tests/test_standings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
client = TestClient(app)


# region standings - good inputs
# region good inputs


def test_get_standings():
response = client.get("/standings")
assert response.status_code == status.HTTP_200_OK
assert response.json()["season"] == 2023
assert response.json()["round"] == 22
assert response.json()["season"] == 2024
assert response.json()["round"] == 1
assert response.json()["DriverStandings"][0] == {
"position": "1",
"positionText": "1",
"points": "575",
"wins": "19",
"points": "26",
"wins": "1",
"Driver": {
"driverId": "max_verstappen",
"permanentNumber": "33",
Expand All @@ -44,8 +44,8 @@ def test_get_standings():
assert response.json()["ConstructorStandings"][0] == {
"position": "1",
"positionText": "1",
"points": "860",
"wins": "21",
"points": "44",
"wins": "1",
"Constructor": {
"constructorId": "red_bull",
"url": "http://en.wikipedia.org/wiki/Red_Bull_Racing",
Expand Down Expand Up @@ -141,9 +141,9 @@ def test_get_standings_good_year_and_round():
}


# endregion standings - good inputs
# endregion good inputs

# region standings - no inputs
# region no inputs


def test_get_standings_good_round_bad_year_no_input():
Expand All @@ -152,4 +152,4 @@ def test_get_standings_good_round_bad_year_no_input():
assert response.json() == {"detail": 'Bad request. Must provide the "year" parameter.'}


# endregion standings - no inputs
# endregion no inputs

0 comments on commit 40312d5

Please sign in to comment.