def setup(self): csv_test_file_path = YSI_TEST_FILES_PATH + '/BAYT_20070323_CDT_YS1772AA_000.csv' ysi_test_file_path = YSI_TEST_FILES_PATH + '/BAYT_20070323_CDT_YS1772AA_000.dat' metadata, self.ysi_reader = sonde(ysi_test_file_path, tzinfo=cdt, remove_invalids=False) self.ysi_csv = ysi_csv_read(csv_test_file_path)
def YSIReaderNaiveDatetime_Test(): """ Test that naive datetimes are allowed """ ysi_test_file_path = YSI_TEST_FILES_PATH + '/BAYT_20070323_CDT_YS1772AA_000.dat' metadata, ysi_reader = sonde(ysi_test_file_path, tzinfo=cdt, remove_invalids=False) assert not ysi_reader.empty
def check_file(test_file, sonde_file): global tz file_format = test_file['header']['format'] # force cst, as the python naive datetime automatically converts # to cst which tends to screw things up if 'tz' in test_file['format_parameters']['tz'] and \ test_file['format_parameters']['tz'].lower() == 'cdt': tz = cdt else: tz = cst print (sonde_file) test_sonde_metadata, test_sonde = sonde3.sonde(sonde_file, tzinfo=tz) check_format_parameters(test_file['format_parameters'], test_sonde_metadata) parameters = test_file['data']['parameters'] units = test_file['data']['units'] for test_data in test_file['data']['test_data']: check_values_match(test_data, parameters, units, test_sonde, test_sonde_metadata)
def sondeYSINaiveDatetime_Test(): ysi_test_file_path = YSI_TEST_FILES_PATH + '/BAYT_20070323_CDT_YS1772AA_000.dat' metadata, ysi_dataset = sonde(ysi_test_file_path, remove_invalids=False) assert not ysi_dataset.empty
def YSIDatasetNaiveDatetime_Test(): ysi_test_file_path = YSI_TEST_FILES_PATH + '/BAYT_20070323_CDT_YS1772AA_000.dat' metadata, ysi_dataset = sonde(ysi_test_file_path) assert not ysi_dataset.empty