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

Function test_render_meta

tests/test_markup.py:201–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

199
200
201def test_render_meta():
202 console = Console()
203 text = render("foo[@click=close]bar[/]baz")
204 assert text.get_style_at_offset(console, 3).meta == {"@click": ("close", ())}
205
206 text = render("foo[@click=close()]bar[/]baz")
207 assert text.get_style_at_offset(console, 3).meta == {"@click": ("close", ())}
208
209 text = render("foo[@click=close('dialog')]bar[/]baz")
210 assert text.get_style_at_offset(console, 3).meta == {
211 "@click": ("close", ("dialog",))
212 }
213 text = render("foo[@click=close('dialog', 3)]bar[/]baz")
214 assert text.get_style_at_offset(console, 3).meta == {
215 "@click": ("close", ("dialog", 3))
216 }
217
218 text = render("foo[@click=(1, 2, 3)]bar[/]baz")
219 assert text.get_style_at_offset(console, 3).meta == {"@click": (1, 2, 3)}

Callers

nothing calls this directly

Calls 3

ConsoleClass · 0.90
renderFunction · 0.90
get_style_at_offsetMethod · 0.80

Tested by

no test coverage detected