@@ -175,60 +175,61 @@ def make_row(
175175 "missing_sample_size" : [missing_sample_size ]
176176 })
177177 return row
178+
179+ details = PathDetails (20200408 , 0 , 'src' , 'sig' , 'day' , 20200408 , 'state' )
178180
179181 # Failure cases.
180182 with pytest .raises (GeoIdSanityCheckException ):
181- CsvImporter .extract_and_check_row ('county' , make_row (geo_id = '1234' ))
183+ CsvImporter .extract_and_check_row ('county' , make_row (geo_id = '1234' ), details )
182184 with pytest .raises (GeoIdSanityCheckException ):
183- CsvImporter .extract_and_check_row ('county' , make_row (geo_id = '00000' ))
185+ CsvImporter .extract_and_check_row ('county' , make_row (geo_id = '00000' ), details )
184186 with pytest .raises (GeoIdSanityCheckException ):
185- CsvImporter .extract_and_check_row ('hrr' , make_row (geo_id = '600' ))
187+ CsvImporter .extract_and_check_row ('hrr' , make_row (geo_id = '600' ), details )
186188 with pytest .raises (GeoIdSanityCheckException ):
187- CsvImporter .extract_and_check_row ('msa' , make_row (geo_id = '1234' ))
189+ CsvImporter .extract_and_check_row ('msa' , make_row (geo_id = '1234' ), details )
188190 with pytest .raises (GeoIdSanityCheckException ):
189- CsvImporter .extract_and_check_row ('msa' , make_row (geo_id = '01234' ))
191+ CsvImporter .extract_and_check_row ('msa' , make_row (geo_id = '01234' ), details )
190192 with pytest .raises (GeoIdSanityCheckException ):
191- CsvImporter .extract_and_check_row ('dma' , make_row (geo_id = '400' ))
193+ CsvImporter .extract_and_check_row ('dma' , make_row (geo_id = '400' ), details )
192194 with pytest .raises (GeoIdSanityCheckException ):
193- CsvImporter .extract_and_check_row ('state' , make_row (geo_id = '48' ))
195+ CsvImporter .extract_and_check_row ('state' , make_row (geo_id = '48' ), details )
194196 with pytest .raises (GeoIdSanityCheckException ):
195- CsvImporter .extract_and_check_row ('state' , make_row (geo_id = 'iowa' ))
197+ CsvImporter .extract_and_check_row ('state' , make_row (geo_id = 'iowa' ), details )
196198 with pytest .raises (GeoIdSanityCheckException ):
197- CsvImporter .extract_and_check_row ('nation' , make_row (geo_id = '0000' ))
199+ CsvImporter .extract_and_check_row ('nation' , make_row (geo_id = '0000' ), details )
198200 with pytest .raises (GeoIdSanityCheckException ):
199- CsvImporter .extract_and_check_row ('hhs' , make_row (geo_id = '0' ))
201+ CsvImporter .extract_and_check_row ('hhs' , make_row (geo_id = '0' ), details )
200202 with pytest .raises (GeoIdSanityCheckException ):
201- CsvImporter .extract_and_check_row ('county' , make_row (geo_id = None ))
203+ CsvImporter .extract_and_check_row ('county' , make_row (geo_id = None ), details )
202204
203205 with pytest .raises (Exception ):
204- CsvImporter .extract_and_check_row ('hrr' , make_row (geo_id = 'hrr001' ))
206+ CsvImporter .extract_and_check_row ('hrr' , make_row (geo_id = 'hrr001' ), details )
205207
206208 with pytest .raises (GeoTypeSanityCheckException ):
207- CsvImporter .extract_and_check_row ('province' , make_row (geo_id = 'ab' ))
209+ CsvImporter .extract_and_check_row ('province' , make_row (geo_id = 'ab' ), details )
208210 with pytest .raises (GeoTypeSanityCheckException ):
209- CsvImporter .extract_and_check_row (None , make_row ())
211+ CsvImporter .extract_and_check_row (None , make_row (), details )
210212
211213 with pytest .raises (ValueSanityCheckException ):
212- CsvImporter .extract_and_check_row ('state' , make_row (stderr = - 1 ))
214+ CsvImporter .extract_and_check_row ('state' , make_row (stderr = - 1 ), details )
213215 with pytest .raises (ValueSanityCheckException ):
214- CsvImporter .extract_and_check_row ('state' , make_row (value = float ('inf' )))
216+ CsvImporter .extract_and_check_row ('state' , make_row (value = float ('inf' )), details )
215217 with pytest .raises (ValueSanityCheckException ):
216- CsvImporter .extract_and_check_row ('state' , make_row (stderr = float ('inf' )))
218+ CsvImporter .extract_and_check_row ('state' , make_row (stderr = float ('inf' )), details )
217219 with pytest .raises (ValueSanityCheckException ):
218- CsvImporter .extract_and_check_row ('state' , make_row (sample_size = float ('inf' )))
219-
220+ CsvImporter .extract_and_check_row ('state' , make_row (sample_size = float ('inf' )), details )
220221
221222 # Success cases with NANs.
222- table = CsvImporter .extract_and_check_row ('state' , make_row ())
223+ table = CsvImporter .extract_and_check_row ('state' , make_row (), details )
223224 assert table .compare (make_row ('vi' , 1.23 , 4.56 , 100.5 , Nans .NOT_MISSING , Nans .NOT_MISSING , Nans .NOT_MISSING )).empty
224225
225- table = CsvImporter .extract_and_check_row ('state' , make_row (value = None , stderr = np .nan , sample_size = None , missing_value = Nans .DELETED , missing_stderr = Nans .DELETED , missing_sample_size = Nans .DELETED ))
226+ table = CsvImporter .extract_and_check_row ('state' , make_row (value = None , stderr = np .nan , sample_size = None , missing_value = Nans .DELETED , missing_stderr = Nans .DELETED , missing_sample_size = Nans .DELETED ), details )
226227 assert table .compare (make_row ('vi' , None , None , None , Nans .DELETED , Nans .DELETED , Nans .DELETED )).empty
227228
228- table = CsvImporter .extract_and_check_row ('state' , make_row (stderr = None , sample_size = np .nan , missing_stderr = Nans .OTHER , missing_sample_size = Nans .OTHER ))
229+ table = CsvImporter .extract_and_check_row ('state' , make_row (stderr = None , sample_size = np .nan , missing_stderr = Nans .OTHER , missing_sample_size = Nans .OTHER ), details )
229230 assert table .compare (make_row ('vi' , 1.23 , None , None , Nans .NOT_MISSING , Nans .OTHER , Nans .OTHER )).empty
230231
231- table = CsvImporter .extract_and_check_row ('state' , make_row (sample_size = None , missing_value = Nans .NOT_MISSING , missing_stderr = Nans .OTHER , missing_sample_size = Nans .NOT_MISSING ))
232+ table = CsvImporter .extract_and_check_row ('state' , make_row (sample_size = None , missing_value = Nans .NOT_MISSING , missing_stderr = Nans .OTHER , missing_sample_size = Nans .NOT_MISSING ), details )
232233 assert table .compare (make_row ('vi' , 1.23 , 4.56 , None , Nans .NOT_MISSING , Nans .NOT_MISSING , Nans .OTHER )).empty
233234
234235
0 commit comments