MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / test_indented_table

Function test_indented_table

tests/test_rich_utils.py:62–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60
61
62def 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(

Callers

nothing calls this directly

Calls 2

printMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…