mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-05 15:35:06 +00:00
fix(downloader): reject a speed limit too large for a float in parse_speed_limit
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user