MCPcopy
hub / github.com/Textualize/rich / test_render_ascii

Function test_render_ascii

tests/test_tree.py:43–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41
42
43def test_render_ascii():
44 tree = Tree("foo")
45 tree.add("bar")
46 tree.add("baz")
47
48 class AsciiConsole(Console):
49 @property
50 def encoding(self):
51 return "ascii"
52
53 console = AsciiConsole(color_system=None, width=20)
54 console.begin_capture()
55 console.print(tree)
56 result = console.end_capture()
57 expected = "foo\n+-- bar\n`-- baz\n"
58 assert result == expected
59
60
61@pytest.mark.skipif(sys.platform == "win32", reason="different on Windows")

Callers

nothing calls this directly

Calls 6

addMethod · 0.95
TreeClass · 0.90
AsciiConsoleClass · 0.85
begin_captureMethod · 0.80
printMethod · 0.80
end_captureMethod · 0.80

Tested by

no test coverage detected