def test_same_day(self): params = { "common": { "data_source": "", "span_length": 0, "end_date": "2020-09-01" } } validator = StaticValidator(params) report = ValidationReport([]) filenames = [("20200901_county_signal_signal.csv", "match_obj")] validator.check_missing_date_files(filenames, report) assert len(report.raised_errors) == 0
def test_empty_filelist(self): params = { "common": { "data_source": "", "span_length": 8, "end_date": "2020-09-09" } } validator = StaticValidator(params) report = ValidationReport([]) report = ValidationReport([]) filenames = list() validator.check_missing_date_files(filenames, report) assert len(report.raised_errors) == 1 assert report.raised_errors[0].check_name == "check_missing_date_files"
def test_duplicate_dates(self): params = { "common": { "data_source": "", "span_length": 1, "end_date": "2020-09-02" } } validator = StaticValidator(params) report = ValidationReport([]) filenames = [("20200901_county_signal_signal.csv", "match_obj"), ("20200903_county_signal_signal.csv", "match_obj"), ("20200903_usa_signal_signal.csv", "match_obj"), ("20200903_usa_signal_signal.csv", "match_obj")] validator.check_missing_date_files(filenames, report) assert len(report.raised_errors) == 1 assert report.raised_errors[0].check_name == "check_missing_date_files"