tests/test_screen.py
raw| 1 | from rich.console import Console |
| 2 | from rich.screen import Screen |
| 3 | |
| 4 | |
| 5 | def test_screen(): |
| 6 | console = Console(color_system=None, width=20, height=5, legacy_windows=False) |
| 7 | with console.capture() as capture: |
| 8 | console.print(Screen("foo\nbar\nbaz\nfoo\nbar\nbaz\foo")) |
| 9 | result = capture.get() |
| 10 | print(repr(result)) |
| 11 | expected = "foo \nbar \nbaz \nfoo \nbar " |
| 12 | assert result == expected |