MCPcopy Index your code
hub / github.com/astanin/python-tabulate / test_maxcolwidth_single_value

Function test_maxcolwidth_single_value

test/test_output.py:159–175  ·  view source on GitHub ↗

Output: maxcolwidth can be specified as a single number that works for each column

()

Source from the content-addressed store, hash-verified

157
158
159def test_maxcolwidth_single_value():
160 "Output: maxcolwidth can be specified as a single number that works for each column"
161 table = [
162 ["hdr", "fold1", "fold2"],
163 ["mini", "this is short", "this is a bit longer"],
164 ]
165 expected = "\n".join(
166 [
167 "hdr fold1 fold2",
168 "mini this this",
169 " is is a",
170 " short bit",
171 " longer",
172 ]
173 )
174 result = tabulate(table, headers="firstrow", tablefmt="plain", maxcolwidths=6)
175 assert_equal(expected, result)
176
177
178def test_maxcolwidth_pad_tailing_widths():

Callers

nothing calls this directly

Calls 2

tabulateFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected