mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 18:18:22 +00:00
Add flag to render in binary/decimal suffix in DownloadColumn
Add a test for rendering binary suffix in test_progress.py
This commit is contained in:
parent
d17b7f5110
commit
630ed8bd7f
2 changed files with 28 additions and 5 deletions
|
@ -88,6 +88,15 @@ def test_download_progress_uses_decimal_units() -> None:
|
|||
assert rendered_progress == expected
|
||||
|
||||
|
||||
def test_download_progress_uses_binary_units() -> None:
|
||||
|
||||
column = DownloadColumn(decimal_suffix=False)
|
||||
test_task = Task(1, "test", 1024, 512, _get_time=lambda: 1.0)
|
||||
rendered_progress = str(column.render(test_task))
|
||||
expected = "0.5/1.0 KiB"
|
||||
assert rendered_progress == expected
|
||||
|
||||
|
||||
def test_task_ids():
|
||||
progress = make_progress()
|
||||
assert progress.task_ids == [0, 1, 2, 4]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue