]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/blobdiff - tests/test_mwmarkup.py
Added test for db_key_to_title.
[philipp/winterrodeln/wrpylib.git] / tests / test_mwmarkup.py
index 1f2e939fa424d35eaa488d114ff68aff3db14cbe..9ddbb07da4447b3d0410d3b2106b2a9c5148ba7f 100644 (file)
@@ -141,3 +141,10 @@ class TestMwParserFromHell(unittest.TestCase):
         wikicode = mwparserfromhell.parse(wikitext)
         tag = next(wikicode.ifilter_tags())
         self.assertEqual('tag', tag.tag)
+
+
+class TestFormatTemplate(unittest.TestCase):
+    def test_format_template_oneline(self):
+        value = mwparserfromhell.parse('{{ my_template ||   | var = 7 }}').filter_templates()[0]
+        wrpylib.mwmarkup.format_template_oneline(value)
+        self.assertEqual('{{my_template| | |var=7}}', value)