Skip to content

Commit a1a1434

Browse files
committed
style(tests): format test covidcast_nowcast with black
1 parent 494865c commit a1a1434

File tree

1 file changed

+35
-29
lines changed

1 file changed

+35
-29
lines changed

tests/acquisition/covidcast_nowcast/test_load_sensors.py

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,41 @@
1313
from delphi.epidata.acquisition.covidcast_nowcast.load_sensors import main, load_and_prepare_file
1414

1515
# py3tester coverage target
16-
__test_target__ = 'delphi.epidata.acquisition.covidcast_nowcast.load_sensors'
16+
__test_target__ = "delphi.epidata.acquisition.covidcast_nowcast.load_sensors"
1717

1818

1919
class UpdateTests(unittest.TestCase):
20-
21-
@mock.patch('time.time', mock.MagicMock(return_value=12345))
22-
def test_load_and_prepare_file(self):
23-
24-
test_attributes = PathDetails(
25-
20210102,
26-
3,
27-
"test_source",
28-
"test_signal",
29-
"test_time_type",
30-
20201231,
31-
"test_geo_type",
32-
)
33-
34-
test_df = load_and_prepare_file(StringIO("sensor_name,geo_value,value\ntestname,01001,1.5"), test_attributes)
35-
pd.testing.assert_frame_equal(test_df,
36-
pd.DataFrame({"sensor_name": ["testname"],
37-
"geo_value": ["01001"],
38-
"value": [1.5],
39-
"source": ["test_source"],
40-
"signal": ["test_signal"],
41-
"time_type": ["test_time_type"],
42-
"geo_type": ["test_geo_type"],
43-
"time_value": [20201231],
44-
"issue": [20210102],
45-
"lag": [3],
46-
"value_updated_timestamp": [12345]})
47-
)
20+
@mock.patch("time.time", mock.MagicMock(return_value=12345))
21+
def test_load_and_prepare_file(self):
22+
23+
test_attributes = PathDetails(
24+
20210102,
25+
3,
26+
"test_source",
27+
"test_signal",
28+
"test_time_type",
29+
20201231,
30+
"test_geo_type",
31+
)
32+
33+
test_df = load_and_prepare_file(
34+
StringIO("sensor_name,geo_value,value\ntestname,01001,1.5"), test_attributes
35+
)
36+
pd.testing.assert_frame_equal(
37+
test_df,
38+
pd.DataFrame(
39+
{
40+
"sensor_name": ["testname"],
41+
"geo_value": ["01001"],
42+
"value": [1.5],
43+
"source": ["test_source"],
44+
"signal": ["test_signal"],
45+
"time_type": ["test_time_type"],
46+
"geo_type": ["test_geo_type"],
47+
"time_value": [20201231],
48+
"issue": [20210102],
49+
"lag": [3],
50+
"value_updated_timestamp": [12345],
51+
}
52+
),
53+
)

0 commit comments

Comments
 (0)