| 29 | |
| 30 | |
| 31 | def render(): |
| 32 | console = Console(file=io.StringIO(), width=100, legacy_windows=False) |
| 33 | |
| 34 | console.rule("empty") |
| 35 | empty_columns = Columns([]) |
| 36 | console.print(empty_columns) |
| 37 | columns = Columns(COLUMN_DATA) |
| 38 | columns.add_renderable("Myrmecophaga tridactyla") |
| 39 | console.rule("optimal") |
| 40 | console.print(columns) |
| 41 | console.rule("optimal, expand") |
| 42 | columns.expand = True |
| 43 | console.print(columns) |
| 44 | console.rule("column first, optimal") |
| 45 | columns.column_first = True |
| 46 | columns.expand = False |
| 47 | console.print(columns) |
| 48 | console.rule("column first, right to left") |
| 49 | columns.right_to_left = True |
| 50 | console.print(columns) |
| 51 | console.rule("equal columns, expand") |
| 52 | columns.equal = True |
| 53 | columns.expand = True |
| 54 | console.print(columns) |
| 55 | console.rule("fixed width") |
| 56 | columns.width = 16 |
| 57 | columns.expand = False |
| 58 | console.print(columns) |
| 59 | console.print() |
| 60 | render_result = console.file.getvalue() |
| 61 | print(render_result) |
| 62 | print(repr(render_result)) |
| 63 | return render_result |
| 64 | |
| 65 | |
| 66 | def test_render(): |