diff emeraldtree/tests/test_ElementTree.py @ 5:9b72cb3ef3c9

Support strings a children. * emeraldtree/ElementTree.py - Only allow Node and basestring as children of an Element. - Check type during iteration. - Serialize all non-Node objects as text. * emeraldtree/tests/test_ElementTree.py: Add tests.
author Bastian Blank <bblank@thinkmo.de>
date Sat, 31 May 2008 15:40:43 +0200
parents 705fc192cd9d
children ced434b6bf72
line wrap: on
line diff
--- a/emeraldtree/tests/test_ElementTree.py	Sat May 31 15:19:09 2008 +0200
+++ b/emeraldtree/tests/test_ElementTree.py	Sat May 31 15:40:43 2008 +0200
@@ -18,3 +18,5 @@
     assert serialize(elem) == '<a><b /></a>'
     elem.append(Element('c'))
     assert serialize(elem) == '<a><b /><c /></a>'
+    elem.append('d')
+    assert serialize(elem) == '<a><b /><c />d</a>'