From 40312d51bee25dfd5c540b1788bb406b6d701b38 Mon Sep 17 00:00:00 2001 From: Pratik Borole Date: Mon, 4 Mar 2024 19:27:05 +0530 Subject: [PATCH] test: updated failing tests --- tests/test_laps.py | 8 ++++---- tests/test_next_event.py | 32 ++++++++++++++++---------------- tests/test_results.py | 8 ++++---- tests/test_schedule.py | 26 +++++++++++++------------- tests/test_standings.py | 20 ++++++++++---------- 5 files changed, 47 insertions(+), 47 deletions(-) diff --git a/tests/test_laps.py b/tests/test_laps.py index fa97fe9..55417b6 100644 --- a/tests/test_laps.py +++ b/tests/test_laps.py @@ -9,7 +9,7 @@ client = TestClient(app) -# region laps - good inputs +# region good inputs def test_get_laps(): @@ -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(): @@ -217,4 +217,4 @@ def test_get_laps_bad_driver_numbers(): assert response.json() == [] -# endregion laps - bad inputs +# endregion bad inputs diff --git a/tests/test_next_event.py b/tests/test_next_event.py index d56e48f..d525ecc 100644 --- a/tests/test_next_event.py +++ b/tests/test_next_event.py @@ -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, } diff --git a/tests/test_results.py b/tests/test_results.py index ad990a1..013c8c1 100644 --- a/tests/test_results.py +++ b/tests/test_results.py @@ -9,7 +9,7 @@ client = TestClient(app) -# region results - good inputs +# region good inputs def test_get_results(): @@ -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(): @@ -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 diff --git a/tests/test_schedule.py b/tests/test_schedule.py index 298d907..aa4f35a 100644 --- a/tests/test_schedule.py +++ b/tests/test_schedule.py @@ -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, } diff --git a/tests/test_standings.py b/tests/test_standings.py index 937791f..3363385 100644 --- a/tests/test_standings.py +++ b/tests/test_standings.py @@ -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", @@ -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", @@ -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(): @@ -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