1
0
Fork 0
terminaltables3/tests/test_build/test_flatten.py
Daniel Baumann 07735c967b
Merging upstream version 4.0.0 (Closes: #1095814).
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-12 15:00:49 +01:00

24 lines
651 B
Python

"""Test function in module."""
from terminaltables3.build import flatten
def test_one_line():
"""Test with one line cells."""
table = [
[">", "Left Cell", "|", "Center Cell", "|", "Right Cell", "<"],
]
actual = flatten(table)
expected = ">Left Cell|Center Cell|Right Cell<"
assert actual == expected
def test_two_line():
"""Test with two line cells."""
table = [
[">", "Left ", "|", "Center", "|", "Right", "<"],
[">", "Cell1", "|", "Cell2 ", "|", "Cell3", "<"],
]
actual = flatten(table)
expected = ">Left |Center|Right<\n" ">Cell1|Cell2 |Cell3<"
assert actual == expected