From 8fb1252aec84bf0de77de4df442f260c5a4d2f98 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Sun, 31 Oct 2010 18:55:30 -0400 Subject: Fixed previous two commits. cElementTree cannot use ElementTree nodes in the tree, but it still uses ElementTree Comment assinged to a node's tag to test for Comment nodes. Also no longer considering Commet nodes to be block level. --- tests/test_apis.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/test_apis.py b/tests/test_apis.py index 114b09d..0de4727 100644 --- a/tests/test_apis.py +++ b/tests/test_apis.py @@ -301,14 +301,18 @@ class testETreeComments(unittest.TestCase): def setUp(self): # Create comment node self.comment = markdown.util.etree.Comment('foo') + if hasattr(markdown.util.etree, 'test_comment'): + self.test_comment = markdown.util.etree.test_comment + else: + self.test_comment = markdown.util.etree.Comment def testCommentIsComment(self): """ Test that an ElementTree Comment passes the `is Comment` test. """ - self.assert_(self.comment.tag is markdown.util.etree.Comment) + self.assert_(self.comment.tag is markdown.util.etree.test_comment) def testCommentIsBlockLevel(self): """ Test that an ElementTree Comment is recognized as BlockLevel. """ - self.assert_(markdown.util.isBlockLevel(self.comment.tag)) + self.assertFalse(markdown.util.isBlockLevel(self.comment.tag)) def testCommentSerialization(self): """ Test that an ElementTree Comment serializes properly. """ -- cgit v1.2.3