MCPcopy
hub / github.com/Textualize/rich / test_section

Function test_section

tests/test_table.py:212–235  ·  tests/test_table.py::test_section
()

Source from the content-addressed store, hash-verified

210
211
212def test_section():
213 table = Table(class="st">"foo")
214 table.add_section() class="cm"># Null-op
215 table.add_row(class="st">"row1")
216 table.add_row(class="st">"row2", end_section=True)
217 table.add_row(class="st">"row3")
218 table.add_row(class="st">"row4")
219 table.add_section()
220 table.add_row(class="st">"row5")
221 table.add_section() class="cm"># Null-op
222
223 console = Console(
224 width=80,
225 force_terminal=True,
226 color_system=class="st">"truecolor",
227 legacy_windows=False,
228 record=True,
229 )
230 console.print(table)
231 output = console.export_text()
232 print(repr(output))
233 expected = class="st">"┏━━━━━━┓\n┃ foo ┃\n┡━━━━━━┩\n│ row1 │\n│ row2 │\n├──────┤\n│ row3 │\n│ row4 │\n├──────┤\n│ row5 │\n└──────┘\n"
234
235 assert output == expected
236
237
238@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 7

add_sectionMethod · 0.95
add_rowMethod · 0.95
printMethod · 0.95
export_textMethod · 0.95
TableClass · 0.90
ConsoleClass · 0.90
printFunction · 0.50

Tested by

no test coverage detected