feat(dl): name the free space of a nearly full temp volume on the failure line

This commit is contained in:
imSp4rky
2026-11-28 14:35:29 -07:00
parent 5167f4f9d9
commit 7856d53950
8 changed files with 156 additions and 9 deletions
+4 -1
View File
@@ -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)