| 60 | |
| 61 | |
| 62 | def test_indented_table() -> None: |
| 63 | console = Console() |
| 64 | |
| 65 | level = 2 |
| 66 | table = Table("Column", box=rich.box.ASCII) |
| 67 | table.add_row("Some Data") |
| 68 | indented_table = ru.indent(table, level) |
| 69 | |
| 70 | with console.capture() as capture: |
| 71 | console.print(indented_table) |
| 72 | result = capture.get().splitlines() |
| 73 | |
| 74 | padding = " " * level |
| 75 | assert result[0].startswith(padding + "+-----------+") |
| 76 | assert result[1].startswith(padding + "| Column |") |
| 77 | assert result[2].startswith(padding + "|-----------|") |
| 78 | assert result[3].startswith(padding + "| Some Data |") |
| 79 | assert result[4].startswith(padding + "+-----------+") |
| 80 | |
| 81 | |
| 82 | @pytest.mark.parametrize( |