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

Function test_update_screen

tests/test_console.py:813–826  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

811
812
813def test_update_screen() -> None:
814 console = Console(force_terminal=True, width=20, height=5, _environ={})
815 if console.legacy_windows:
816 return
817 with pytest.raises(errors.NoAltScreen):
818 console.update_screen("foo")
819 console.begin_capture()
820 with console.screen():
821 console.update_screen("foo")
822 console.update_screen("bar", region=Region(2, 3, 8, 4))
823 result = console.end_capture()
824 print(repr(result))
825 expected = "\x1b[?1049h\x1b[H\x1b[?25l\x1b[1;1Hfoo \x1b[2;1H \x1b[3;1H \x1b[4;1H \x1b[5;1H \x1b[4;3Hbar \x1b[5;3H \x1b[6;3H \x1b[7;3H \x1b[?1049l\x1b[?25h"
826 assert result == expected
827
828
829def test_update_screen_lines() -> None:

Callers

nothing calls this directly

Calls 7

update_screenMethod · 0.95
begin_captureMethod · 0.95
screenMethod · 0.95
end_captureMethod · 0.95
ConsoleClass · 0.90
RegionClass · 0.90
printFunction · 0.50

Tested by

no test coverage detected