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

Function test_padding

tests/test_styles_cache.py:61–92  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

59
60
61def test_padding():
62 content = [
63 Strip([Segment("foo")]),
64 Strip([Segment("bar")]),
65 Strip([Segment("baz")]),
66 ]
67 styles = Styles()
68 styles.padding = 1
69 cache = StylesCache()
70 lines = cache.render(
71 styles,
72 Size(5, 5),
73 Color.parse("blue"),
74 Color.parse("green"),
75 content.__getitem__,
76 [],
77 None,
78 None,
79 content_size=Size(3, 3),
80 )
81
82 text_content = _extract_content(lines)
83
84 expected_text = [
85 " ",
86 " foo ",
87 " bar ",
88 " baz ",
89 " ",
90 ]
91
92 assert text_content == expected_text
93
94
95def test_padding_border():

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…