Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion tests/test_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ def test_location_class(
)

assert location_obj.country_code == country_code
assert not location_obj.serialize() == None
assert location_obj.serialize() is not None
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function test_location_class refactored with the following changes:

  • Use x is None rather than x == None
  • Simplify logical expression

4 changes: 2 additions & 2 deletions tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ async def test_v1_all(self):
assert return_data == json.loads(expected_json_output)

async def test_v2_latest(self):
state = "latest"

with mock.patch("app.services.location.jhu.datetime") as mock_datetime:
mock_datetime.utcnow.return_value.isoformat.return_value = DATETIME_STRING
mock_datetime.strptime.side_effect = mocked_strptime_isoformat
state = "latest"

Comment on lines -90 to +94
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function FlaskRoutesTest.test_v2_latest refactored with the following changes:

  • Move assignments closer to their usage

response = await self.asgi_client.get(f"/v2/{state}")

return_data = response.json()
Expand Down