diff options
Diffstat (limited to 'test/netlib')
-rw-r--r-- | test/netlib/test_human.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/netlib/test_human.py b/test/netlib/test_human.py index 3a445c0b..464d4646 100644 --- a/test/netlib/test_human.py +++ b/test/netlib/test_human.py @@ -1,6 +1,8 @@ from netlib import human, tutils def test_parse_size(): + assert human.parse_size("0") == 0 + assert human.parse_size("0b") == 0 assert human.parse_size("1") == 1 assert human.parse_size("1k") == 1024 assert human.parse_size("1m") == 1024**2 @@ -10,10 +12,12 @@ def test_parse_size(): def test_pretty_size(): - assert human.pretty_size(100) == "100B" - assert human.pretty_size(1024) == "1kB" - assert human.pretty_size(1024 + (1024 / 2.0)) == "1.5kB" - assert human.pretty_size(1024 * 1024) == "1MB" + assert human.pretty_size(0) == "0b" + assert human.pretty_size(100) == "100b" + assert human.pretty_size(1024) == "1k" + assert human.pretty_size(1024 + (1024 / 2.0)) == "1.5k" + assert human.pretty_size(1024 * 1024) == "1m" + assert human.pretty_size(10 * 1024 * 1024) == "10m" def test_pretty_duration(): |