mirror of
https://github.com/Textualize/rich.git
synced 2025-08-04 01:58:24 +00:00
docs for spinner and status
This commit is contained in:
parent
be47b3f899
commit
df1dc1ddcb
10 changed files with 216 additions and 35 deletions
21
tests/test_status.py
Normal file
21
tests/test_status.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from time import sleep
|
||||
|
||||
from rich.console import Console
|
||||
from rich.status import Status
|
||||
from rich.table import Table
|
||||
|
||||
|
||||
def test_status():
|
||||
|
||||
console = Console(
|
||||
color_system=None, width=80, legacy_windows=False, get_time=lambda: 0.0
|
||||
)
|
||||
status = Status("foo", console=console)
|
||||
assert status.console == console
|
||||
status.update(status="bar", spinner="dots2", spinner_style="red", speed=2.0)
|
||||
|
||||
assert isinstance(status.renderable, Table)
|
||||
|
||||
# TODO: Testing output is tricky with threads
|
||||
with status:
|
||||
sleep(0.2)
|
Loading…
Add table
Add a link
Reference in a new issue