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

Function test_append

tests/test_text.py:349–361  ·  tests/test_text.py::test_append
()

Source from the content-addressed store, hash-verified

347
348
349def test_append():
350 text = Text(class="st">"foo")
351 text.append(class="st">"bar")
352 assert str(text) == class="st">"foobar"
353 text.append(Text(class="st">"baz", class="st">"bold"))
354 assert str(text) == class="st">"foobarbaz"
355 assert text._spans == [Span(6, 9, class="st">"bold")]
356
357 with pytest.raises(ValueError):
358 text.append(Text(class="st">"foo"), class="st">"bar")
359
360 with pytest.raises(TypeError):
361 text.append(1)
362
363
364def test_append_text():

Callers

nothing calls this directly

Calls 3

appendMethod · 0.95
TextClass · 0.90
SpanClass · 0.90

Tested by

no test coverage detected