shutil.move(self.netcdf_tmp_file_path, remove_creation_date_from_filename(self.netcdf_tmp_file_path)) self.netcdf_tmp_file_path = remove_creation_date_from_filename(self.netcdf_tmp_file_path) def tearDown(self): shutil.copy(self.netcdf_tmp_file_path, os.path.join(os.environ['data_wip_path'], 'nc_unittest_%s.nc' % self.md5_netcdf_value)) shutil.rmtree(os.path.dirname(self.netcdf_tmp_file_path)) def test_aims_validation(self): self.md5_expected_value = '18770178cd71c228e8b59ccba3c7b8b5' self.md5_netcdf_value = md5(self.netcdf_tmp_file_path) self.assertEqual(self.md5_netcdf_value, self.md5_expected_value) if __name__ == '__main__': me = singleton.SingleInstance() os.environ['data_wip_path'] = os.path.join(os.environ.get('WIP_DIR'), 'SOOP', 'SOOP_TRV_RSS_Download_temporary') set_up() res = data_validation_test.main(exit=False) logger = logging_aims() if res.result.wasSuccessful(): process_qc_level(1) # no need to process level 0 for SOOP TRV else: logger.warning('Data validation unittests failed') close_logger(logger) exit(0)
parser = argparse.ArgumentParser() parser.add_argument("-t", "--testing", action='store_true', help="testing only - downloads the first month of each channel") return parser.parse_args() if __name__ == '__main__': vargs = args() me = singleton.SingleInstance() os.environ['data_wip_path'] = os.path.join(os.environ.get('WIP_DIR'), 'ANMN', 'NRS_AIMS_Darwin_Yongala_data_rss_download_temporary') global TMP_MANIFEST_DIR global TESTING set_up() # data validation test runner = data_validation_test.TextTestRunner() itersuite = data_validation_test.TestLoader().loadTestsFromTestCase(AimsDataValidationTest) res = runner.run(itersuite) logger = logging_aims() if not DATA_WIP_PATH: logger.error('environment variable data_wip_path is not defined.') exit(1) # script optional argument for testing only. used in process_monthly_channel TESTING = vargs.testing rm_tmp_dir(DATA_WIP_PATH)