From 15c1f8314f2b1cd525be12435e97a409efb2d5a5 Mon Sep 17 00:00:00 2001 From: Mads Jensen Date: Wed, 28 Feb 2018 20:21:22 +0100 Subject: [PATCH] Added tests for the wikilinks plugin. --- src/wiki/plugins/macros/mdx/wikilinks.py | 1 - tests/plugins/macros/test_links.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 tests/plugins/macros/test_links.py diff --git a/src/wiki/plugins/macros/mdx/wikilinks.py b/src/wiki/plugins/macros/mdx/wikilinks.py index 31e375b6..4379fe1a 100644 --- a/src/wiki/plugins/macros/mdx/wikilinks.py +++ b/src/wiki/plugins/macros/mdx/wikilinks.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python """ Extend the shipped Markdown extension 'wikilinks' """ diff --git a/tests/plugins/macros/test_links.py b/tests/plugins/macros/test_links.py new file mode 100644 index 00000000..5cd30aa9 --- /dev/null +++ b/tests/plugins/macros/test_links.py @@ -0,0 +1,12 @@ +from tests.base import RequireRootArticleMixin, TestBase +from wiki.core import markdown +from wiki.plugins.macros.mdx.wikilinks import WikiLinkExtension + + +class WikiLinksTests(RequireRootArticleMixin, TestBase): + def test_wikilink(self): + md = markdown.ArticleMarkdown(article=self.root_article, extensions=[WikiLinkExtension()]) + md_text = md.convert('[[Root Article]]') + self.assertEqual( + md_text, '

Root Article

' + ) -- 2.45.2