mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-30 13:05:08 +00:00
feat(dl): name the free space of a nearly full temp volume on the failure line
This commit is contained in:
@@ -15,6 +15,7 @@ import rnet
|
||||
from tests.downloaders.test_content_encoding import _FakeRnetResponse
|
||||
from tests.downloaders.test_rnet_session_paths import SESSIONS
|
||||
from unshackle.core.constants import DOWNLOAD_CANCELLED
|
||||
from unshackle.core.remote_protocol import APIErrorCode
|
||||
from unshackle.core.session import MaxRetriesError
|
||||
from unshackle.core.utilities import get_free_port
|
||||
|
||||
@@ -117,14 +118,16 @@ def test_disk_full_is_not_retried(tmp_path, monkeypatch, serve):
|
||||
assert raised.value.errno == errno.ENOSPC
|
||||
assert server.requests == 1
|
||||
assert dl.retries_exhausted(raised.value)
|
||||
assert raised.value.error_code == APIErrorCode.DOWNLOAD_ERROR
|
||||
|
||||
|
||||
def test_status_failure_keeps_the_normal_budget(tmp_path, serve):
|
||||
server = serve(503)
|
||||
with pytest.raises(rq.HTTPError):
|
||||
with pytest.raises(rq.HTTPError) as raised:
|
||||
list(dl.download(url=server.url, save_path=tmp_path / "a.bin", session=rq.Session()))
|
||||
|
||||
assert server.requests == dl.MAX_ATTEMPTS
|
||||
assert not hasattr(raised.value, "error_code")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("make_session", SESSIONS)
|
||||
|
||||
Reference in New Issue
Block a user