diff emeraldtree/tests/test_ElementTree.py @ 10:fc4b72233da0

Add testcases. emeraldtree/tests/test_ElementTree.py: Add testcases for Comment and ProcessingInstruction.
author Bastian Blank <bblank@thinkmo.de>
date Sat, 31 May 2008 16:20:53 +0200
parents e1d0cd336bf3
children 60f59340b897
line wrap: on
line diff
--- a/emeraldtree/tests/test_ElementTree.py	Sat May 31 16:19:33 2008 +0200
+++ b/emeraldtree/tests/test_ElementTree.py	Sat May 31 16:20:53 2008 +0200
@@ -49,6 +49,19 @@
     l = list(elem.itertext())
     assert len(l) == 1
 
+def test_Comment():
+    elem = Comment('a')
+    assert serialize(elem) == '<!--a-->'
+    assert isinstance(elem, Node)
+
+def test_ProcessingInstruction():
+    elem = ProcessingInstruction('a')
+    assert serialize(elem) == '<?a?>'
+    assert isinstance(elem, ProcessingInstruction)
+
+    elem = ProcessingInstruction('a', 'b')
+    assert serialize(elem) == '<?a b?>'
+
 def test_XMLParser_simple1():
     elem = XML('<a />')
     assert elem.tag == 'a'