@@ -47,21 +47,19 @@ def test_find_issue_specific_csv_files(self):
4747
4848 path_prefix = 'prefix/to/the/data/'
4949 #valid day path
50- glob_paths = [path_prefix + '/archive/failed/src-name/issue_20200408' ]
51- issue_path = '/archive/failed/src-name/issue_20200408'
50+ issue_path = 'issue_20200408'
51+ glob_issue_path = path_prefix + issue_path
52+ glob_file_path = path_prefix + issue_path + '/valid/20200408_nation_sig.csv'
5253 mock_glob = MagicMock ()
53- mock_glob .glob .return_value = glob_paths
54- issuedir_match = CsvImporter .PATTERN_ISSUE_DIR .match (issue_path .lower ())
54+ mock_glob .glob .side_effect = ([ glob_issue_path ], [ glob_file_path ])
55+ issuedir_match = CsvImporter .PATTERN_ISSUE_DIR .match (glob_issue_path .lower ())
5556 issue_date_value = int (issuedir_match .group (2 ))
5657
5758 #check if the day is a valid issue day.
5859 self .assertTrue (CsvImporter .is_sane_day (issue_date_value ))
5960
60- with self .assertRaises (Exception ):
61- CsvImporter .find_issue_specific_csv_files (path_prefix , glob = mock_glob )
62-
63-
64-
61+ found = set (CsvImporter .find_issue_specific_csv_files (path_prefix , glob = mock_glob ))
62+ self .assertTrue (len (found )> 0 )
6563
6664 def test_find_csv_files (self ):
6765 """Recursively explore and find CSV files."""
@@ -327,4 +325,4 @@ def test_load_csv_with_valid_header(self):
327325 self .assertEqual (rows [2 ].missing_stderr , Nans .NOT_MISSING )
328326 self .assertEqual (rows [2 ].missing_sample_size , Nans .REGION_EXCEPTION )
329327
330- self .assertIsNone (rows [3 ])
328+ self .assertIsNone (rows [3 ])
0 commit comments