Skip to content
Snippets Groups Projects
Commit 88a0e0b8 authored by Alan De Smet's avatar Alan De Smet
Browse files

Fix test; failed download now raises Exception

parent 28c54f10
Branches
No related tags found
No related merge requests found
...@@ -593,9 +593,10 @@ class DownloaderTests(DTestCase): ...@@ -593,9 +593,10 @@ class DownloaderTests(DTestCase):
test_datetime = datetime.datetime(2000,1,1,12,0,0) test_datetime = datetime.datetime(2000,1,1,12,0,0)
outfile = "avhrr-only-v2.19990101.nc" outfile = "avhrr-only-v2.19990101.nc"
with TemporaryDirectory() as dirpath: with TemporaryDirectory() as dirpath:
with self.assertLogs(level='ERROR') as logs: with self.assertRaises(csppfetch.DownloadsFailedException) as raised:
d.download_for_time(test_datetime, dirpath,retries=1) # do_download = True, download_stats = None with self.assertLogs(level='ERROR') as logs:
self.assertFileDoesNotExist(dirpath+"/"+outfile) d.download_for_time(test_datetime, dirpath,retries=1) # do_download = True, download_stats = None
self.assertFileDoesNotExist(dirpath+"/"+outfile)
self.assertRegex(logs.output[0], r'^ERROR:root:Unable to download any file set') self.assertRegex(logs.output[0], r'^ERROR:root:Unable to download any file set')
self.assertRegex(logs.output[1], r'HTTP Error 404') self.assertRegex(logs.output[1], r'HTTP Error 404')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment