MCPcopy Create free account
hub / github.com/astanin/python-tabulate / test_maxcolwidth_pad_tailing_widths

Function test_maxcolwidth_pad_tailing_widths

test/test_output.py:178–195  ·  view source on GitHub ↗

Output: maxcolwidth, if only partly specified, pads tailing cols with None

()

Source from the content-addressed store, hash-verified

176
177
178def test_maxcolwidth_pad_tailing_widths():
179 "Output: maxcolwidth, if only partly specified, pads tailing cols with None"
180 table = [
181 ["hdr", "fold1", "fold2"],
182 ["mini", "this is short", "this is a bit longer"],
183 ]
184 expected = "\n".join(
185 [
186 "hdr fold1 fold2",
187 "mini this this is a bit longer",
188 " is",
189 " short",
190 ]
191 )
192 result = tabulate(
193 table, headers="firstrow", tablefmt="plain", maxcolwidths=[None, 6]
194 )
195 assert_equal(expected, result)
196
197
198def test_maxcolwidth_honor_disable_parsenum():

Callers

nothing calls this directly

Calls 2

tabulateFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected