Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add unittests for last bugfix

  • Loading branch information...
commit 1e4eb5bec7918c1baac7d219191ee1dce6c5164e 1 parent 9e5b5dd
@jedie authored
View
5 creole/tests/test_html2creole.py
@@ -395,6 +395,11 @@ def test_horizontal_rule(self):
<p>two</p>
""")
+ def test_nested_empty_tags(self):
+ self.assert_html2creole2("TEST", "<p>TEST</p>")
+ self.assert_html2creole2("TEST", "<bar><p>TEST</p></bar>")
+ self.assert_html2creole2("TEST", "<foo><bar><p>TEST</p></bar></foo>")
+
# def test_nowiki1(self):
# self.assert_html2creole(r"""
View
22 creole/tests/utils/base_unittest.py
@@ -145,6 +145,15 @@ def assert_creole2html(self, raw_creole, raw_html, \
# compare
self.assertEqual(out_string, html_string, msg="creole2html")
+ def assert_html2creole2(self, creole, html, debug=False, unknown_emit=None):
+ # convert html code into creole markup
+ out_string = html2creole(html, debug, unknown_emit=unknown_emit)
+ if debug:
+ self._debug_text("assert_html2creole() html2creole", out_string)
+
+ # compare
+ self.assertEqual(out_string, creole, msg="html2creole")
+
def assert_html2creole(self, raw_creole, raw_html, \
strip_lines=False, debug=False,
# OLD API:
@@ -165,21 +174,16 @@ def assert_html2creole(self, raw_creole, raw_html, \
self.assertNotEqual(raw_creole, raw_html)
# prepare whitespace on test strings
- markup = self._prepare_text(raw_creole)
- assert isinstance(markup, TEXT_TYPE)
+ creole = self._prepare_text(raw_creole)
+ assert isinstance(creole, TEXT_TYPE)
if debug:
- self._debug_text("assert_creole2html() markup", markup)
+ self._debug_text("assert_creole2html() markup", creole)
html = self._prepare_text(raw_html)
assert isinstance(html, TEXT_TYPE)
- # convert html code into creole markup
- out_string = html2creole(html, debug, unknown_emit=unknown_emit)
- if debug:
- self._debug_text("assert_html2creole() html2creole", out_string)
+ self.assert_html2creole2(creole, html, debug, unknown_emit)
- # compare
- self.assertEqual(out_string, markup, msg="html2creole")
def cross_compare_creole(self, creole_string, html_string,
strip_lines=False, debug=False,
Please sign in to comment.
Something went wrong with that request. Please try again.