We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5cd2b1 commit 2f7d719Copy full SHA for 2f7d719
1 file changed
tests/test_misc.py
@@ -4,13 +4,15 @@
4
5
6
def test_bytes_to_human_readable_simple():
7
+ """Ensure common sizes are formatted into human-readable strings."""
8
assert bytes_to_human_readable(500) == "500.0 bytes"
9
assert bytes_to_human_readable(2048) == "2.0 KB"
10
assert bytes_to_human_readable(1024 * 1024) == "1.0 MB"
11
assert bytes_to_human_readable(5 * 1024**3) == "5.0 GB"
12
13
14
def test_bytes_to_human_readable_large():
15
+ """Verify formatting for large sizes such as terabytes."""
16
# 1.5 TB in bytes should format as 1.5 TB
17
size = int(1.5 * (1024**4))
18
assert bytes_to_human_readable(size) == "1.5 TB"
0 commit comments