| 583 | |
| 584 | |
| 585 | def test_save_html() -> None: |
| 586 | expected = '<!DOCTYPE html>\n<html>\n<head>\n<meta charset="UTF-8">\n<style>\n\nbody {\n color: #000000;\n background-color: #ffffff;\n}\n</style>\n</head>\n<body>\n <pre style="font-family:Menlo,\'DejaVu Sans Mono\',consolas,\'Courier New\',monospace"><code style="font-family:inherit">foo\n</code></pre>\n</body>\n</html>\n' |
| 587 | console = Console(record=True, width=100) |
| 588 | console.print("foo") |
| 589 | with tempfile.TemporaryDirectory() as path: |
| 590 | export_path = os.path.join(path, "example.html") |
| 591 | console.save_html(export_path) |
| 592 | with open(export_path, "rt") as html_file: |
| 593 | html = html_file.read() |
| 594 | print(repr(html)) |
| 595 | assert html == expected |
| 596 | |
| 597 | |
| 598 | def test_no_wrap() -> None: |