def test_more_cols(self): table = [["", "taste", "land speed", "life"], ["spam", 300101, 4, 1003], ["eggs", 105, 13, "n/a"]] out = StringIO() ppt(out, table) actual = out.getvalue().rstrip() expected = """ taste land speed life spam 300,101 4 1,003 eggs 105 13 n/a""" assert actual == expected, "\n" + actual
def test_spammy_table(self): table = [["", "taste", "land speed", "life"], ["spam", 300101, 4, 1003], ["eggs", 105, 13, 42], ["lumberjacks", 13, 105, 10]] out = StringIO() ppt(out, table) actual = out.getvalue().rstrip() expected = """ taste land speed life spam 300,101 4 1,003 eggs 105 13 42 lumberjacks 13 105 10""" assert actual == expected, "\n" + actual
def test_more_rows(self): table = [["", "taste", "land speed"], ["spam", 300101, 4], ["eggs", 105, 13], ["lumberjacks", 13, 105]] out = StringIO() ppt(out, table) actual = out.getvalue().rstrip() expected = """ taste land speed spam 300,101 4 eggs 105 13 lumberjacks 13 105""" assert actual == expected, "\n" + actual