Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Formatting & version (#32)
* formatting

* increment version
  • Loading branch information
Kilo59 authored May 20, 2020
commit 4bde047b18b7ec0f60ef06e36286a2af18cbeb09
2 changes: 1 addition & 1 deletion app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion app/services/location/csbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 18 additions & 3 deletions tests/test_jhu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
assert response_json["latest"]["deaths"]