| 85 | |
| 86 | @pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows") |
| 87 | def test_refresh_screen(): |
| 88 | layout = Layout() |
| 89 | layout.split_row(Layout(name="foo"), Layout(name="bar")) |
| 90 | console = Console(force_terminal=True, width=20, height=5, _environ={}) |
| 91 | with console.capture(): |
| 92 | console.print(layout) |
| 93 | with console.screen(): |
| 94 | with console.capture() as capture: |
| 95 | layout.refresh_screen(console, "foo") |
| 96 | result = capture.get() |
| 97 | print() |
| 98 | print(repr(result)) |
| 99 | expected = "\x1b[1;1H\x1b[34m╭─\x1b[0m\x1b[34m \x1b[0m\x1b[32m'foo'\x1b[0m\x1b[34m─╮\x1b[0m\x1b[2;1H\x1b[34m│\x1b[0m \x1b[1;35mLayout\x1b[0m \x1b[34m│\x1b[0m\x1b[3;1H\x1b[34m│\x1b[0m \x1b[1m(\x1b[0m \x1b[34m│\x1b[0m\x1b[4;1H\x1b[34m│\x1b[0m \x1b[33mna\x1b[0m \x1b[34m│\x1b[0m\x1b[5;1H\x1b[34m╰────────╯\x1b[0m" |
| 100 | assert result == expected |