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

Function test_getitem

tests/test_content.py:71–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69
70
71def test_getitem():
72 content = Content("Hello, world").stylize("blue", 0, 5)
73 assert content[0].plain == "H"
74 assert content[0]._spans == [Span(0, 1, "blue")]
75 assert content[-1].plain == "d"
76 assert content[-1]._spans == []
77 assert content[:2].plain == "He"
78 assert content[:2]._spans == [Span(0, 2, "blue")]
79
80
81def test_cell_length():

Callers

nothing calls this directly

Calls 3

ContentClass · 0.90
SpanClass · 0.90
stylizeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…