Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions table2ascii/preset_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ class PresetStyle:
ascii_rounded = TableStyle.from_string("/===\|| |=|=||-|-|\|=/")
ascii_rounded_box = TableStyle.from_string("/===\||||=||||-|||\||/")
markdown = TableStyle.from_string(" ||||-||| ")
plain = TableStyle.from_string(" ")
18 changes: 18 additions & 0 deletions tests/test_styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,3 +649,21 @@ def test_markdown():
"| SUM | 130 | 140 | 135 | 130 |"
)
assert text == expected


def test_plain():
text = t2a(
header=["#", "G", "H", "R", "S"],
body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
footer=["SUM", "130", "140", "135", "130"],
first_col_heading=True,
last_col_heading=False,
style=PresetStyle.plain,
)
expected = (
" # G H R S \n"
" 1 30 40 35 30 \n"
" 2 30 40 35 30 \n"
" SUM 130 140 135 130 "
)
assert text == expected