Test Content.assemble constructor.
()
| 217 | |
| 218 | |
| 219 | def 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( |
nothing calls this directly
no test coverage detected
searching dependent graphs…