Use "kB" for `DownloadColumn`

This commit is contained in:
Brian Rutledge 2022-02-21 06:01:53 -05:00
parent 8c3e6be424
commit 156c9c450e
No known key found for this signature in database
GPG Key ID: D411764EE1DA4B90
2 changed files with 4 additions and 2 deletions

View File

@ -427,7 +427,9 @@ class DownloadColumn(ProgressColumn):
) )
else: else:
unit, suffix = filesize.pick_unit_and_suffix( unit, suffix = filesize.pick_unit_and_suffix(
total, ["bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], 1000 total,
["bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
1000,
) )
completed_ratio = completed / unit completed_ratio = completed / unit
total_ratio = total / unit total_ratio = total / unit

View File

@ -123,7 +123,7 @@ def test_download_progress_uses_decimal_units() -> None:
column = DownloadColumn() column = DownloadColumn()
test_task = Task(1, "test", 1000, 500, _get_time=lambda: 1.0) test_task = Task(1, "test", 1000, 500, _get_time=lambda: 1.0)
rendered_progress = str(column.render(test_task)) rendered_progress = str(column.render(test_task))
expected = "0.5/1.0 KB" expected = "0.5/1.0 kB"
assert rendered_progress == expected assert rendered_progress == expected