Skip to content

Commit 020a5f4

Browse files
committed
test missing keys: append new columns on the right
1 parent 0b7247e commit 020a5f4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test/test_input.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,13 @@ def test_list_of_dicts_keys():
335335

336336

337337
def test_list_of_dicts_with_missing_keys():
338-
"Input: a list of dictionaries, with keys as headers."
339-
lod = [{"foo": 2}, {"bar": 3}]
338+
"Input: a list of dictionaries, with missing keys."
339+
lod = [{"foo": 1}, {"bar": 2}, {"foo":4, "baz": 3}]
340340
expected = "\n".join([
341-
' foo bar',
342-
'----- -----',
343-
' 2',
344-
' 3'])
341+
' foo bar baz',
342+
'----- ----- -----',
343+
' 1',
344+
' 2',
345+
' 4 3'])
345346
result = tabulate(lod, headers="keys")
346347
assert_equal(expected, result)

0 commit comments

Comments
 (0)