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

Function test_markup_property

tests/test_text.py:1034–1047  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1032
1033
1034def test_markup_property():
1035 assert Text("").markup == ""
1036 assert Text("foo").markup == "foo"
1037 assert Text("foo", style="bold").markup == "[bold]foo[/bold]"
1038 assert Text.from_markup("foo [red]bar[/red]").markup == "foo [red]bar[/red]"
1039 assert (
1040 Text.from_markup("foo [red]bar[/red]", style="bold").markup
1041 == "[bold]foo [red]bar[/red][/bold]"
1042 )
1043 assert (
1044 Text.from_markup("[bold]foo [italic]bar[/bold] baz[/italic]").markup
1045 == "[bold]foo [italic]bar[/bold] baz[/italic]"
1046 )
1047 assert Text("[bold]foo").markup == "\\[bold]foo"
1048
1049
1050def test_extend_style():

Callers

nothing calls this directly

Calls 2

TextClass · 0.90
from_markupMethod · 0.80

Tested by

no test coverage detected