| 68 | |
| 69 | |
| 70 | def test_tree(): |
| 71 | layout = Layout(name="root") |
| 72 | layout.split(Layout("foo", size=2), Layout("bar", name="bar")) |
| 73 | layout["bar"].split_row(Layout(), Layout()) |
| 74 | |
| 75 | console = Console(width=60, color_system=None) |
| 76 | |
| 77 | with console.capture() as capture: |
| 78 | console.print(layout.tree, height=10) |
| 79 | result = capture.get() |
| 80 | print(repr(result)) |
| 81 | expected = "⬍ Layout(name='root')\n├── ⬍ Layout(size=2)\n└── ⬌ Layout(name='bar')\n ├── ⬍ Layout()\n └── ⬍ Layout()\n" |
| 82 | print(result, "\n", expected) |
| 83 | assert result == expected |
| 84 | |
| 85 | |
| 86 | @pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows") |