зеркало из https://github.com/mozilla/bugbug.git
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:
Родитель
6fdc9dc487
Коммит
d54472f027
|
@ -85,7 +85,7 @@ def download(path, force=False, support_files_too=False):
|
||||||
|
|
||||||
except requests.exceptions.HTTPError:
|
except requests.exceptions.HTTPError:
|
||||||
print(f"{url} is not yet available to download")
|
print(f"{url} is not yet available to download")
|
||||||
raise
|
return
|
||||||
|
|
||||||
extract_file(zst_path)
|
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")
|
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"):
|
with pytest.raises(Exception, match="Last-Modified is not available"):
|
||||||
db.last_modified(db_path)
|
db.last_modified(db_path)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче