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

Function test_render_size

tests/test_panel.py:61–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59
60
61def test_render_size() -> None:
62 console = Console(width=63, height=46, legacy_windows=False)
63 options = console.options.update_dimensions(80, 4)
64 lines = console.render_lines(Panel("foo", title="Hello"), options=options)
65 print(repr(lines))
66 expected = [
67 [
68 Segment("╭─", Style()),
69 Segment(
70 "────────────────────────────────── Hello ───────────────────────────────────"
71 ),
72 Segment("─╮", Style()),
73 ],
74 [
75 Segment("│", Style()),
76 Segment(" ", Style()),
77 Segment("foo"),
78 Segment(
79 " ",
80 Style(),
81 ),
82 Segment(" ", Style()),
83 Segment("│", Style()),
84 ],
85 [
86 Segment("│", Style()),
87 Segment(" ", Style()),
88 Segment(
89 " ",
90 Style(),
91 ),
92 Segment(" ", Style()),
93 Segment("│", Style()),
94 ],
95 [
96 Segment(
97 "╰──────────────────────────────────────────────────────────────────────────────╯",
98 Style(),
99 )
100 ],
101 ]
102 assert lines == expected
103
104
105def test_title_text() -> None:

Callers

nothing calls this directly

Calls 7

render_linesMethod · 0.95
ConsoleClass · 0.90
PanelClass · 0.90
SegmentClass · 0.90
StyleClass · 0.90
update_dimensionsMethod · 0.80
printFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…