()
| 60 | |
| 61 | @pytest.mark.skipif(sys.platform == "win32", reason="different on Windows") |
| 62 | def test_render_tree_non_win32(): |
| 63 | tree = Tree("foo") |
| 64 | tree.add("bar", style="italic") |
| 65 | baz_tree = tree.add("baz", guide_style="bold red", style="on blue") |
| 66 | baz_tree.add("1") |
| 67 | baz_tree.add("2") |
| 68 | tree.add("egg") |
| 69 | |
| 70 | console = Console( |
| 71 | width=20, force_terminal=True, color_system="standard", _environ={} |
| 72 | ) |
| 73 | console.begin_capture() |
| 74 | console.print(tree) |
| 75 | result = console.end_capture() |
| 76 | print(repr(result)) |
| 77 | 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" |
| 78 | assert result == expected |
| 79 | |
| 80 | |
| 81 | @pytest.mark.skipif(sys.platform != "win32", reason="Windows specific") |
nothing calls this directly
no test coverage detected