mirror of https://github.com/Textualize/rich.git
Use "kB" for `DownloadColumn`
This commit is contained in:
parent
8c3e6be424
commit
156c9c450e
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue