diff --git a/tests/test_pagure_lib.py b/tests/test_pagure_lib.py index 0fcb6fc..d816823 100644 --- a/tests/test_pagure_lib.py +++ b/tests/test_pagure_lib.py @@ -4284,6 +4284,46 @@ class PagureLibtests(tests.Modeltests): } ) + def test_text2markdown_table(self): + """ Test the text2markdown function with a markdown table. """ + + text = """ +| Left-aligned | Center-aligned | Right-aligned | +| :--- | :---: | ---: | +| git status | git status | git status | +| git diff | git diff | git diff | + + +foo bar + """ + + expected = """
| Left-aligned | +Center-aligned | +Right-aligned | +
|---|---|---|
| git status | +git status | +git status | +
| git diff | +git diff | +git diff | +
foo bar
""" + + with pagure.APP.app_context(): + html = pagure.lib.text2markdown(text) + self.assertEqual(html, expected) + if __name__ == '__main__': SUITE = unittest.TestLoader().loadTestsFromTestCase(PagureLibtests)