MCPcopy Index your code
hub / github.com/Textualize/textual / test_border

Function test_border

tests/test_styles_cache.py:27–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25
26
27def test_border():
28 content = [
29 Strip([Segment("foo")]),
30 Strip([Segment("bar")]),
31 Strip([Segment("baz")]),
32 ]
33 styles = Styles()
34 styles.border = ("heavy", "white")
35 cache = StylesCache()
36 lines = cache.render(
37 styles,
38 Size(5, 5),
39 Color.parse("blue"),
40 Color.parse("green"),
41 content.__getitem__,
42 [],
43 None,
44 None,
45 content_size=Size(3, 3),
46 )
47
48 text_content = _extract_content(lines)
49
50 expected_text = [
51 "┏━━━┓",
52 "┃foo┃",
53 "┃bar┃",
54 "┃baz┃",
55 "┗━━━┛",
56 ]
57
58 assert text_content == expected_text
59
60
61def test_padding():

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…