Download benchmark/python/py-premature-filesize-rollover/initial.patch from RedinGhost/beforedone-paper: direct link, hf CLI and curl.
- Browser
- Download file 719 Bytes
-
https://huggingface.co/datasets/RedinGhost/beforedone-paper/resolve/main/benchmark/python/py-premature-filesize-rollover/initial.patch
- Command line
-
hf download hf://datasets/RedinGhost/beforedone-paper/benchmark/python/py-premature-filesize-rollover/initial.patch
-
curl -L -o initial.patch https://huggingface.co/datasets/RedinGhost/beforedone-paper/resolve/main/benchmark/python/py-premature-filesize-rollover/initial.patch
719 Bytes
| diff --git a/tests/test_filesize.py b/tests/test_filesize.py | |
| index e695639..c564bf2 100644 | |
| --- a/tests/test_filesize.py | |
| +++ b/tests/test_filesize.py | |
| def test_naturalsize(test_args: list[int] | list[int | bool], expected: str) -> | |
| test_args[0] = f"-{test_args[0]}" | |
| assert humanize.naturalsize(*test_args) == "-" + expected | |
| + | |
| + | |
| +def test_naturalsize_can_keep_the_pre_rounding_suffix() -> None: | |
| + assert humanize.naturalsize(999_999, format="%.1f", rollover=False) == "1000.0 kB" | |
| + assert ( | |
| + humanize.naturalsize(1024**2 - 1, binary=True, rollover=False) | |
| + == "1024.0 KiB" | |
| + ) | |
| + assert humanize.naturalsize(1024**2 - 1, gnu=True, rollover=False) == "1024.0K" | |