diff --git a/app/main.py b/app/main.py index b43b4aae..b9aff949 100644 --- a/app/main.py +++ b/app/main.py @@ -34,7 +34,7 @@ "API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak." " Project page: https://github.com/ExpDev07/coronavirus-tracker-api." ), - version="2.0.3", + version="2.0.4", docs_url="/", redoc_url="/docs", on_startup=[setup_client_session], diff --git a/app/services/location/csbs.py b/app/services/location/csbs.py index ddfe48b7..444ebad6 100644 --- a/app/services/location/csbs.py +++ b/app/services/location/csbs.py @@ -97,6 +97,6 @@ async def get_locations(): await load_cache(data_id, locations) except TypeError as type_err: LOGGER.error(type_err) - + # Return the locations. return locations diff --git a/tests/test_jhu.py b/tests/test_jhu.py index f6af4b9e..65f960db 100644 --- a/tests/test_jhu.py +++ b/tests/test_jhu.py @@ -35,9 +35,24 @@ async def test_get_locations(mock_client_session): @pytest.mark.parametrize( "key, locations, index, expected", [ - (("Thailand", "TH"), [{"country": "Thailand", "province": "TH", "history": {"test": "yes"}}], 0, {"test": "yes"}), # Success - (("Deutschland", "DE"), [{"country": "Deutschland", "province": "DE", "history": {"test": "no"}}], 1, {}), # IndexError - (("US", "NJ"), [{"country": "Deutschland", "province": "DE", "history": {"test": "no"}}], 0, {}), # Invaid Key Merge + ( + ("Thailand", "TH"), + [{"country": "Thailand", "province": "TH", "history": {"test": "yes"}}], + 0, + {"test": "yes"}, + ), # Success + ( + ("Deutschland", "DE"), + [{"country": "Deutschland", "province": "DE", "history": {"test": "no"}}], + 1, + {}, + ), # IndexError + ( + ("US", "NJ"), + [{"country": "Deutschland", "province": "DE", "history": {"test": "no"}}], + 0, + {}, + ), # Invaid Key Merge ], ) def test_parse_history(key, locations, index, expected): diff --git a/tests/test_routes.py b/tests/test_routes.py index 5c81641b..5143ca8a 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -185,4 +185,4 @@ async def test_latest(async_api_client, query_params, mock_client_session): assert response.status_code == 200 assert response_json["latest"]["confirmed"] - assert response_json["latest"]["deaths"] \ No newline at end of file + assert response_json["latest"]["deaths"]