changeset 2371:7de0a5eebf76

first simple test for link markup, fails
author Johannes Berg <johannes AT sipsolutions DOT net>
date Thu, 12 Jul 2007 13:34:22 +0200
parents 6d9970321d79
children 704c1051e73f
files MoinMoin/parser/_tests/test_text_moin_wiki.py
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/_tests/test_text_moin_wiki.py	Thu Jul 12 11:45:51 2007 +0200
+++ b/MoinMoin/parser/_tests/test_text_moin_wiki.py	Thu Jul 12 13:34:22 2007 +0200
@@ -573,3 +573,23 @@
         assert expected == result
 
 
+class TestLinkingMarkup(ParserTestCase):
+    """ Test wiki markup """
+
+    text = 'AAA %s AAA'
+    needle = re.compile(text % r'(.+)')
+    _tests = (
+        # test,                     expected
+        ('["something"]',           '<a class="nonexistent" href="./something">something</a>'),
+        ("['something']",           "['something']"),
+        )
+
+    def testTextFormating(self):
+        """ parser.wiki: text formating """
+        for test, expected in self._tests:
+            html = self.parse(self.text % test)
+            result = self.needle.search(html).group(1)
+            self.assertEqual(result, expected,
+                             'Expected "%(expected)s" but got "%(result)s"' % locals())
+
+