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

Function test_indented_text

tests/test_rich_utils.py:44–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42
43
44def test_indented_text() -> None:
45 console = Console(width=20)
46
47 # With an indention of 10, text will be evenly split across two lines.
48 text = "A" * 20
49 level = 10
50 indented_text = ru.indent(text, level)
51
52 with console.capture() as capture:
53 console.print(indented_text)
54 result = capture.get().splitlines()
55
56 padding = " " * level
57 expected_line = padding + ("A" * 10)
58 assert result[0] == expected_line
59 assert result[1] == expected_line
60
61
62def test_indented_table() -> None:

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…