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

Function test_clear_meta_and_links

tests/test_style.py:234–253  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232
233
234def test_clear_meta_and_links():
235 style = Style.parse("bold red on black link https://example.org") + Style.on(
236 click="CLICK"
237 )
238
239 assert style.meta == {"@click": "CLICK"}
240 assert style.link == "https://example.org"
241 assert style.color == Color.parse("red")
242 assert style.bgcolor == Color.parse("black")
243 assert style.bold
244 assert not style.italic
245
246 clear_style = style.clear_meta_and_links()
247
248 assert clear_style.meta == {}
249 assert clear_style.link == None
250 assert clear_style.color == Color.parse("red")
251 assert clear_style.bgcolor == Color.parse("black")
252 assert clear_style.bold
253 assert not clear_style.italic
254
255
256def test_clear_meta_and_links_clears_hash():

Callers

nothing calls this directly

Calls 3

clear_meta_and_linksMethod · 0.80
parseMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected