Don't raise an exception when a DB is not yet available

For example, the first time a task is created.
This commit is contained in:
Marco Castelluccio 2019-07-23 01:56:48 +02:00
Родитель 6fdc9dc487
Коммит d54472f027
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -85,7 +85,7 @@ def download(path, force=False, support_files_too=False):
except requests.exceptions.HTTPError:
print(f"{url} is not yet available to download")
raise
return
extract_file(zst_path)

Просмотреть файл

@ -193,8 +193,8 @@ def test_download_missing(tmp_path):
responses.GET, url, status=404, body=requests.exceptions.HTTPError("HTTP error")
)
with pytest.raises(requests.exceptions.HTTPError):
db.download(db_path)
db.download(db_path)
assert not os.path.exists(db_path)
with pytest.raises(Exception, match="Last-Modified is not available"):
db.last_modified(db_path)