From c7f3852004cdd22aca73efe1926ee1a144632244 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 11 2017 16:28:57 +0000 Subject: Add unit-tests for text2markdown with a table having orientation --- 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-alignedCenter-alignedRight-aligned
git statusgit statusgit status
git diffgit diffgit 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)