MCPcopy
hub / github.com/Textualize/rich / test_spinner_column

Function test_spinner_column

tests/test_progress.py:129–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127
128
129def test_spinner_column():
130 time = 1.0
131
132 def get_time():
133 nonlocal time
134 return time
135
136 column = SpinnerColumn()
137 column.set_spinner("dots2")
138 task = Task(1, "test", 100, 20, _get_time=get_time)
139 result = column.render(task)
140 print(repr(result))
141 expected = "⣾"
142 assert str(result) == expected
143
144 time += 1.0
145 column.spinner.update(speed=0.5)
146 result = column.render(task)
147 print(repr(result))
148 expected = "⡿"
149 assert str(result) == expected
150
151
152def test_download_progress_uses_decimal_units() -> None:

Callers

nothing calls this directly

Calls 6

set_spinnerMethod · 0.95
renderMethod · 0.95
SpinnerColumnClass · 0.90
TaskClass · 0.90
printFunction · 0.50
updateMethod · 0.45

Tested by

no test coverage detected