# HG changeset patch # User Bastian Blank # Date 1212239447 -7200 # Node ID 40db0b033d47f6220595fb394e79a7dfb2afcc95 # Parent 3a98d2fcc70ec87320dfa5027196f5029c6b0418 Add testcases. * emeraldtree/tests/__init__.py: Add. * emeraldtree/tests/test_ElementTree.py: Add testcases. diff -r 3a98d2fcc70e -r 40db0b033d47 emeraldtree/tests/test_ElementTree.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emeraldtree/tests/test_ElementTree.py Sat May 31 15:10:47 2008 +0200 @@ -0,0 +1,19 @@ +from emeraldtree.ElementTree import ElementTree, Element + +def serialize(elem, **options): + from cStringIO import StringIO + file = StringIO() + tree = ElementTree(elem) + tree.write(file, **options) + return file.getvalue() + +def test_Element___init__(): + elem = Element('a') + assert serialize(elem) == '' + +def test_Element_append(): + elem = Element('a') + elem.append(Element('b')) + assert serialize(elem) == '' + elem.append(Element('c')) + assert serialize(elem) == ''