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

Function test_assemble

tests/test_content.py:219–237  ·  view source on GitHub ↗

Test Content.assemble constructor.

()

Source from the content-addressed store, hash-verified

217
218
219def test_assemble():
220 """Test Content.assemble constructor."""
221 content = Content.assemble(
222 "Assemble: ", # Simple text
223 Content.from_markup(
224 "pieces of [red]text[/red] or [blue]content[/blue] into "
225 ), # Other Content
226 ("a single Content instance", "underline"), # A tuple of text and a style
227 )
228 assert (
229 content.plain
230 == "Assemble: pieces of text or content into a single Content instance"
231 )
232 print(content.spans)
233 assert content.spans == [
234 Span(20, 24, style="red"),
235 Span(28, 35, style="blue"),
236 Span(41, 66, style="underline"),
237 ]
238
239
240@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

SpanClass · 0.90
assembleMethod · 0.80
from_markupMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…