File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
tests/acquisition/covidcast Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,27 @@ def test_is_sane_week(self):
4141 self .assertFalse (CsvImporter .is_sane_week (202000 ))
4242 self .assertFalse (CsvImporter .is_sane_week (202054 ))
4343 self .assertFalse (CsvImporter .is_sane_week (20200418 ))
44+
45+ def test_find_issue_specific_csv_files (self ):
46+ """Recursively explore and find issue specific CSV files."""
47+
48+ path_prefix = 'prefix/to/the/data/'
49+ #valid day path
50+ glob_paths = [path_prefix + '/archive/failed/src-name/issue_20200408' ]
51+ issue_path = '/archive/failed/src-name/issue_20200408'
52+ mock_glob = MagicMock ()
53+ mock_glob .glob .return_value = glob_paths
54+ issuedir_match = CsvImporter .PATTERN_ISSUE_DIR .match (issue_path .lower ())
55+ issue_date_value = int (issuedir_match .group (2 ))
56+
57+ #check if the day is a valid issue day.
58+ self .assertTrue (CsvImporter .is_sane_day (issue_date_value ))
59+
60+ with self .assertRaises (Exception ):
61+ CsvImporter .find_issue_specific_csv_files (path_prefix , glob = mock_glob )
62+
63+
64+
4465
4566 def test_find_csv_files (self ):
4667 """Recursively explore and find CSV files."""
You can’t perform that action at this time.
0 commit comments