You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
656 B
27 lines
656 B
4 years ago
|
#!/usr/bin/env python3
|
||
|
from markdown_it import MarkdownIt
|
||
|
import os
|
||
|
import unittest
|
||
|
|
||
|
from common.basedir import BASEDIR
|
||
|
from common.markdown import parse_markdown
|
||
|
|
||
|
|
||
|
class TestMarkdown(unittest.TestCase):
|
||
|
# validate that our simple markdown parser produces the same output as `markdown_it` from pip
|
||
|
def test_current_release_notes(self):
|
||
|
self.maxDiff = None
|
||
|
|
||
|
with open(os.path.join(BASEDIR, "RELEASES.md")) as f:
|
||
|
for r in f.read().split("\n\n"):
|
||
|
|
||
|
# No hyperlink support is ok
|
||
|
if '[' in r:
|
||
|
continue
|
||
|
|
||
|
self.assertEqual(MarkdownIt().render(r), parse_markdown(r))
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
unittest.main()
|