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

Function test_live_screen

tests/test_live.py:161–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159
160
161def test_live_screen() -> None:
162 console = create_capture_console(width=20, height=5)
163 console.begin_capture()
164 with Live(Text("foo"), screen=True, console=console, auto_refresh=False) as live:
165 live.refresh()
166 result = console.end_capture()
167 print(repr(result))
168 expected = "\x1b[?1049h\x1b[H\x1b[?25l\x1b[Hfoo \n \n \n \n \x1b[Hfoo \n \n \n \n \x1b[?25h\x1b[?1049l"
169 assert result == expected
170
171
172def test_live_empty() -> None:

Callers

nothing calls this directly

Calls 7

LiveClass · 0.90
TextClass · 0.90
create_capture_consoleFunction · 0.85
begin_captureMethod · 0.80
end_captureMethod · 0.80
printFunction · 0.50
refreshMethod · 0.45

Tested by

no test coverage detected