| 103 | |
| 104 | |
| 105 | def test_title_text() -> None: |
| 106 | panel = Panel( |
| 107 | "Hello, World", |
| 108 | title=Text("title", style="red"), |
| 109 | subtitle=Text("subtitle", style="magenta bold"), |
| 110 | ) |
| 111 | console = Console( |
| 112 | file=io.StringIO(), |
| 113 | width=50, |
| 114 | height=20, |
| 115 | legacy_windows=False, |
| 116 | force_terminal=True, |
| 117 | color_system="truecolor", |
| 118 | ) |
| 119 | console.print(panel) |
| 120 | |
| 121 | result = console.file.getvalue() |
| 122 | print(repr(result)) |
| 123 | expected = "╭────────────────────\x1b[31m title \x1b[0m─────────────────────╮\n│ Hello, World │\n╰───────────────────\x1b[1;35m subtitle \x1b[0m───────────────────╯\n" |
| 124 | assert result == expected |
| 125 | |
| 126 | |
| 127 | def test_title_text_with_border_color() -> None: |