# Copyright The IETF Trust 2023, All Rights Reserved """Markdown API utilities tests""" from textwrap import dedent from ietf.utils.tests import TestCase from ietf.utils.markdown import markdown class MarkdownTests(TestCase): SAMPLE_MARKDOWN = dedent( """ # IETF Markdown Test File This file contains a bunch of constructs to test our markdown converter in `ietf/utils/markdown.py`. ## Links * https://example.com * * [Example](https://example.com) * user@example.com * * [User](mailto:user@example.com) * RFC2119 * BCP 3 * STD 1 * FYI2 * draft-ietf-opsec-indicators-of-compromise * draft-ietf-opsec-indicators-of-compromise-01 """ ) SAMPLE_MARKDOWN_OUTPUT = dedent( """

IETF Markdown Test File

This file contains a bunch of constructs to test our markdown converter in
ietf/utils/markdown.py.

""" ).strip() def test_markdown(self): result = markdown(self.SAMPLE_MARKDOWN) self.assertEqual(result, self.SAMPLE_MARKDOWN_OUTPUT)