def test_get(self): test_config.clear_test_data() q = {'satellite': 'S3A', 'query': SMALL_SIZE_QUERY} files = scihub.search(q, limit=2) main.get(q, limit=2) for f in files: ext = '.zip' with self.subTest(product=f['filename']): self.assertTrue( os.path.isfile( os.path.join(config.CONFIG['GENERAL']['DATA_DIR'], f['filename']) + ext))
def test_check_file_zip_corrupt(self): test_config.clear_test_data() test_config.copy_corrupt_data() for f in utils.ls(config.CONFIG['GENERAL']['DATA_DIR']): with self.subTest(file=f): # # Assert that the files are detected as corrupt in `file` mode. # try: file_path, healthy, message = \ check.check_file(f, mode='file') self.assertFalse(healthy) except Exception as e: self.fail('File check failed: {}'.format(e))
def tearDown(self): test_config.clear_test_data()
def setUp(self): test_config.clear_test_data()