MCPcopy
hub / github.com/Textualize/textual / test_padding_border

Function test_padding_border

tests/test_styles_cache.py:95–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

93
94
95def test_padding_border():
96 content = [
97 Strip([Segment("foo")]),
98 Strip([Segment("bar")]),
99 Strip([Segment("baz")]),
100 ]
101 styles = Styles()
102 styles.padding = 1
103 styles.border = ("heavy", "white")
104 cache = StylesCache()
105 lines = cache.render(
106 styles,
107 Size(7, 7),
108 Color.parse("blue"),
109 Color.parse("green"),
110 content.__getitem__,
111 [],
112 None,
113 None,
114 content_size=Size(3, 3),
115 )
116
117 text_content = _extract_content(lines)
118
119 expected_text = [
120 "┏━━━━━┓",
121 "┃ ┃",
122 "┃ foo ┃",
123 "┃ bar ┃",
124 "┃ baz ┃",
125 "┃ ┃",
126 "┗━━━━━┛",
127 ]
128
129 assert text_content == expected_text
130
131
132def test_outline():

Callers

nothing calls this directly

Calls 7

renderMethod · 0.95
StripClass · 0.90
StylesClass · 0.90
StylesCacheClass · 0.90
SizeClass · 0.90
_extract_contentFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…