2020-03-05 05:42:07 +00:00
|
|
|
"""Test helpers."""
|
|
|
|
|
2021-01-01 21:31:56 +00:00
|
|
|
from unittest.mock import Mock, patch
|
2020-03-05 05:42:07 +00:00
|
|
|
|
2021-01-01 21:31:56 +00:00
|
|
|
import pytest
|
2020-04-30 20:29:50 +00:00
|
|
|
|
2020-03-05 05:42:07 +00:00
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def mock_cases():
|
|
|
|
"""Mock coronavirus cases."""
|
|
|
|
with patch(
|
|
|
|
"coronavirus.get_cases",
|
|
|
|
return_value=[
|
|
|
|
Mock(country="Netherlands", confirmed=10, recovered=8, deaths=1, current=1),
|
|
|
|
Mock(country="Germany", confirmed=1, recovered=0, deaths=0, current=0),
|
2020-06-23 04:22:52 +00:00
|
|
|
Mock(
|
|
|
|
country="Sweden",
|
|
|
|
confirmed=None,
|
|
|
|
recovered=None,
|
|
|
|
deaths=None,
|
|
|
|
current=None,
|
|
|
|
),
|
2020-03-05 05:42:07 +00:00
|
|
|
],
|
|
|
|
) as mock_get_cases:
|
|
|
|
yield mock_get_cases
|