changeset 24:2015d11467bc

Add testcase. emeraldtree/tests/test_ElementTree.py: Add testcase for Element.__nonzero__.
author Bastian Blank <bblank@thinkmo.de>
date Fri, 06 Jun 2008 22:01:07 +0200
parents 4c1912ff58a3
children 47ae505e63ea
files emeraldtree/tests/test_ElementTree.py
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/emeraldtree/tests/test_ElementTree.py	Fri Jun 06 21:57:12 2008 +0200
+++ b/emeraldtree/tests/test_ElementTree.py	Fri Jun 06 22:01:07 2008 +0200
@@ -10,15 +10,21 @@
 
 def test_Element():
     elem = Element('a')
+
     assert isinstance(elem, Node)
     assert elem.tag == 'a'
-    assert elem
 
 def test_Element__len__():
     elem = Element('a', children = range(10))
 
     assert len(elem) == 10
 
+def test_Element__nonzero__():
+    elem = Element('a')
+
+    assert elem
+    assert len(elem) == 0
+
 def test_Element___getitem__():
     elem = Element('a', children = [Element('b'), Element('c')])
 
@@ -57,6 +63,7 @@
 
 def test_Element_append():
     elem = Element('a')
+
     elem.append(Element('b'))
     assert len(elem) == 1
     assert elem[0].tag == 'b'