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