Skip to content

Commit

Permalink
Tests: add test case for markdown tables
Browse files Browse the repository at this point in the history
the markdown test cases were missing tests for the table extension
  • Loading branch information
wagner-intevation committed Sep 20, 2023
1 parent a1147ae commit 6085a41
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/moin/converters/_tests/test_markdown_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,15 @@ def test_list(self, input, output):
def test_image(self, input, output):
self.do(input, output)

data = [
('First Header | Second Header\n------------- | -------------\nContent Cell | Content Cell\nContent Cell | Content Cell',
'<table><table-header><table-row><table-cell-head>First Header</table-cell-head><table-cell-head>Second Header</table-cell-head></table-row></table-header><table-body><table-row><table-cell>Content Cell</table-cell><table-cell>Content Cell</table-cell></table-row><table-row><table-cell>Content Cell</table-cell><table-cell>Content Cell</table-cell></table-row></table-body></table>'),
]

@pytest.mark.parametrize('input,output', data)
def test_table(self, input, output):
self.do(input, output)

def serialize_strip(self, elem, **options):
result = serialize(elem, namespaces=self.namespaces, **options)
return self.output_re.sub('', result)
Expand Down

0 comments on commit 6085a41

Please sign in to comment.