| 159 | |
| 160 | |
| 161 | def test_vertical_align_top(): |
| 162 | console = Console(_environ={}) |
| 163 | |
| 164 | def make_table(vertical_align): |
| 165 | table = Table(show_header=False, box=box.SQUARE) |
| 166 | table.add_column(vertical=vertical_align) |
| 167 | table.add_row("foo", "\n".join(["bar"] * 5)) |
| 168 | |
| 169 | return table |
| 170 | |
| 171 | with console.capture() as capture: |
| 172 | console.print(make_table("top")) |
| 173 | console.print() |
| 174 | console.print(make_table("middle")) |
| 175 | console.print() |
| 176 | console.print(make_table("bottom")) |
| 177 | console.print() |
| 178 | result = capture.get() |
| 179 | print(repr(result)) |
| 180 | expected = "┌─────┬─────┐\n│ foo │ bar │\n│ │ bar │\n│ │ bar │\n│ │ bar │\n│ │ bar │\n└─────┴─────┘\n\n┌─────┬─────┐\n│ │ bar │\n│ │ bar │\n│ foo │ bar │\n│ │ bar │\n│ │ bar │\n└─────┴─────┘\n\n┌─────┬─────┐\n│ │ bar │\n│ │ bar │\n│ │ bar │\n│ │ bar │\n│ foo │ bar │\n└─────┴─────┘\n\n" |
| 181 | assert result == expected |
| 182 | |
| 183 | |
| 184 | @pytest.mark.parametrize( |