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

Function test_save_svg

tests/test_console.py:563–572  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

561
562
563def test_save_svg() -> None:
564 console = Console(record=True, width=100)
565 console.print(
566 "[b red on blue reverse]foo[/] [blink][link=https://example.org]Click[/link]"
567 )
568 with tempfile.TemporaryDirectory() as path:
569 export_path = os.path.join(path, "example.svg")
570 console.save_svg(export_path)
571 with open(export_path, "rt", encoding="utf-8") as svg_file:
572 assert svg_file.read() == EXPECTED_SVG
573
574
575def test_save_text() -> None:

Callers

nothing calls this directly

Calls 6

printMethod · 0.95
save_svgMethod · 0.95
ConsoleClass · 0.90
openFunction · 0.85
joinMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected