()
| 80 | |
| 81 | @pytest.mark.skipif(sys.platform != "win32", reason="Windows specific") |
| 82 | def test_render_tree_win32(): |
| 83 | tree = Tree("foo") |
| 84 | tree.add("bar", style="italic") |
| 85 | baz_tree = tree.add("baz", guide_style="bold red", style="on blue") |
| 86 | baz_tree.add("1") |
| 87 | baz_tree.add("2") |
| 88 | tree.add("egg") |
| 89 | |
| 90 | console = Console( |
| 91 | width=20, force_terminal=True, color_system="standard", legacy_windows=True |
| 92 | ) |
| 93 | console.begin_capture() |
| 94 | console.print(tree) |
| 95 | result = console.end_capture() |
| 96 | print(repr(result)) |
| 97 | expected = "foo\n├── \x1b[3mbar\x1b[0m\n\x1b[44m├── \x1b[0m\x1b[44mbaz\x1b[0m\n\x1b[44m│ \x1b[0m\x1b[31;44m├── \x1b[0m\x1b[44m1\x1b[0m\n\x1b[44m│ \x1b[0m\x1b[31;44m└── \x1b[0m\x1b[44m2\x1b[0m\n└── egg\n" |
| 98 | assert result == expected |
| 99 | |
| 100 | |
| 101 | @pytest.mark.skipif(sys.platform == "win32", reason="different on Windows") |
nothing calls this directly
no test coverage detected