Skip to content

Commit 4570423

Browse files
committed
turn on usafacts::test_run
1 parent e678651 commit 4570423

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

usafacts/tests/test_run.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import pytest
22

3+
from itertools import product
34
from os import listdir
45
from os.path import join
56

@@ -10,7 +11,7 @@
1011
class TestRun:
1112
def test_output_files_exist(self, run_as_module):
1213

13-
csv_files = listdir("receiving")
14+
csv_files = [f for f in listdir("receiving") if f.endswith(".csv")]
1415

1516
dates = [
1617
"20200229",
@@ -23,27 +24,25 @@ def test_output_files_exist(self, run_as_module):
2324
"20200307",
2425
"20200308",
2526
"20200309",
26-
"202003010",
27+
"20200310",
2728
]
2829
geos = ["county", "hrr", "msa", "state"]
29-
metrics = [
30-
"deaths_cumulative_num",
31-
"deaths_incidence_num",
32-
"deaths_incidence_prop",
33-
"confirmed_cumulative_num",
34-
"confirmed_incidence_num",
35-
"confirmed_incidence_prop",
36-
"deaths_7dav_cumulative_prop",
37-
"confirmed_7dav_cumulative_prop",
38-
]
30+
31+
# enumerate metric names.
32+
metrics = []
33+
for event, span, stat in product(["deaths", "confirmed"],
34+
["cumulative", "incidence"],
35+
["num", "prop"]):
36+
metrics.append("_".join([event, span, stat]))
37+
metrics.append("_".join([event, "7dav", span, stat]))
3938

4039
expected_files = []
4140
for date in dates:
4241
for geo in geos:
4342
for metric in metrics:
4443
expected_files += [date + "_" + geo + "_" + metric + ".csv"]
4544

46-
set(csv_files) == set(expected_files)
45+
assert set(csv_files) == set(expected_files)
4746

4847
def test_output_file_format(self, run_as_module):
4948

0 commit comments

Comments
 (0)