()
| 347 | |
| 348 | |
| 349 | def 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 | |
| 364 | def test_append_text(): |