mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 10:08:40 +00:00
Add progress update test to validate advance behaviour
This commit is contained in:
parent
43d3b04725
commit
5dc8b901ac
1 changed files with 11 additions and 0 deletions
|
@ -170,6 +170,17 @@ def test_task_ids():
|
|||
assert progress.task_ids == [0, 1, 2, 4]
|
||||
|
||||
|
||||
def test_task_advance():
|
||||
progress = make_progress()
|
||||
|
||||
task = progress.tasks[-1]
|
||||
task_initial_complete = task.completed
|
||||
|
||||
advance_amount = 50
|
||||
progress.update(task.id, advance=advance_amount)
|
||||
assert progress.tasks[-1].completed == task_initial_complete + advance_amount
|
||||
|
||||
|
||||
def test_finished():
|
||||
progress = make_progress()
|
||||
assert not progress.finished
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue