fix(downloader): reject a speed limit too large for a float in parse_speed_limit

This commit is contained in:
imSp4rky
2026-12-04 16:15:49 -07:00
parent d26910d281
commit dd524f2cb2
3 changed files with 24 additions and 4 deletions
+18 -1
View File
@@ -45,7 +45,24 @@ def test_parse_speed_limit(value, expected):
@pytest.mark.parametrize(
"value",
["fast", "10TB", "10MiB", "-5M", "M", "1..5M", ".", "1.2.3", float("inf"), float("nan"), -5, -1.5],
[
"fast",
"10TB",
"10MiB",
"-5M",
"M",
"1..5M",
".",
"1.2.3",
float("inf"),
float("nan"),
-5,
-1.5,
pytest.param("9" * 400 + "k", id="400-digits-k"),
pytest.param("9" * 400, id="400-digits"),
pytest.param("9" * 308 + "g", id="308-digits-g"),
pytest.param(10**400, id="int-10e400"),
],
)
def test_parse_speed_limit_rejects(value):
with pytest.raises(ValueError):