| 221 | |
| 222 | |
| 223 | def test_expand_bar() -> None: |
| 224 | console = Console( |
| 225 | file=io.StringIO(), |
| 226 | force_terminal=True, |
| 227 | width=10, |
| 228 | color_system="truecolor", |
| 229 | legacy_windows=False, |
| 230 | _environ={}, |
| 231 | ) |
| 232 | progress = Progress( |
| 233 | BarColumn(bar_width=None), |
| 234 | console=console, |
| 235 | get_time=lambda: 1.0, |
| 236 | auto_refresh=False, |
| 237 | ) |
| 238 | progress.add_task("foo") |
| 239 | with progress: |
| 240 | pass |
| 241 | expected = "\x1b[?25l\x1b[38;5;237m━━━━━━━━━━\x1b[0m\r\x1b[2K\x1b[38;5;237m━━━━━━━━━━\x1b[0m\n\x1b[?25h" |
| 242 | render_result = console.file.getvalue() |
| 243 | print("RESULT\n", repr(render_result)) |
| 244 | print("EXPECTED\n", repr(expected)) |
| 245 | assert render_result == expected |
| 246 | |
| 247 | |
| 248 | def test_progress_with_none_total_renders_a_pulsing_bar() -> None: |