|
1 | 1 | """Tests for file size humanization."""
|
| 2 | + |
2 | 3 | from __future__ import annotations
|
3 | 4 |
|
4 | 5 | import pytest
|
@@ -55,12 +56,30 @@ def test_file_size_gnu(params: tuple[int, bool, bool], expected: str) -> None:
|
55 | 56 | "params, expected",
|
56 | 57 | [
|
57 | 58 | ((1, False, True, ".3f", ".1f"), "1.0B"), # unit number (small formatting)
|
58 |
| - ((999, False, False, ".3f", ".1f"), "999.0 Bytes"), # hundreds number (small formatting) |
59 |
| - ((1000, False, False, ".3f", ".1f"), "1.000 KB"), # hundreds number (small formatting boundary) |
60 |
| - ((1023, False, True, ".3f", ".1f"), "1023.0B"), # hundreds number (small formatting boundary) |
61 |
| - ((1024, False, True, ".3f", ".1f"), "1.000K"), # hundreds number (small formatting boundary) |
62 |
| - ((1023, True, False, ".3f", ".1f"), "1023.0 Bytes"), # hundreds number (small formatting boundary) |
63 |
| - ((1024, True, False, ".3f", ".1f"), "1.000 KiB"), # hundreds number (small formatting boundary) |
| 59 | + ( |
| 60 | + (999, False, False, ".3f", ".1f"), |
| 61 | + "999.0 Bytes", |
| 62 | + ), # hundreds number (small formatting) |
| 63 | + ( |
| 64 | + (1000, False, False, ".3f", ".1f"), |
| 65 | + "1.000 KB", |
| 66 | + ), # hundreds number (small formatting boundary) |
| 67 | + ( |
| 68 | + (1023, False, True, ".3f", ".1f"), |
| 69 | + "1023.0B", |
| 70 | + ), # hundreds number (small formatting boundary) |
| 71 | + ( |
| 72 | + (1024, False, True, ".3f", ".1f"), |
| 73 | + "1.000K", |
| 74 | + ), # hundreds number (small formatting boundary) |
| 75 | + ( |
| 76 | + (1023, True, False, ".3f", ".1f"), |
| 77 | + "1023.0 Bytes", |
| 78 | + ), # hundreds number (small formatting boundary) |
| 79 | + ( |
| 80 | + (1024, True, False, ".3f", ".1f"), |
| 81 | + "1.000 KiB", |
| 82 | + ), # hundreds number (small formatting boundary) |
64 | 83 | ((2900000, False, True, ".3f"), "2.766M"), # millions number (large formatting)
|
65 | 84 | (
|
66 | 85 | (2000000000, True, False, ".3f"),
|
|
0 commit comments