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

Function test_save_text

tests/test_console.py:575–582  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

573
574
575def test_save_text() -> None:
576 console = Console(record=True, width=100)
577 console.print("foo")
578 with tempfile.TemporaryDirectory() as path:
579 export_path = os.path.join(path, "rich.txt")
580 console.save_text(export_path)
581 with open(export_path, "rt") as text_file:
582 assert text_file.read() == "foo\n"
583
584
585def test_save_html() -> None:

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected