diff emeraldtree/tests/test_tree.py @ 58:9d0db78957e0

cosmetic changes for findtext() tests
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 18 May 2010 13:25:59 +0200
parents c1feee84d5d8
children 33f5e57f1b97
line wrap: on
line diff
--- a/emeraldtree/tests/test_tree.py	Tue May 18 13:20:51 2010 +0200
+++ b/emeraldtree/tests/test_tree.py	Tue May 18 13:25:59 2010 +0200
@@ -102,19 +102,6 @@
     result = elem.find(u'{url1}b1')
     assert result is child_1
 
-def test_Element_findtext_default():
-    elem = Element(u'a')
-    default_text = u'defaulttext'
-    result = elem.findtext(u'b', default=default_text)
-    assert result is default_text
-
-def test_Element_findtext():
-    child_text = u"text"
-    child = Element(u'b', children=(child_text, ))
-    elem = Element(u'a', children=(child, ))
-    result = elem.findtext(u'b')
-    assert result is child_text
-
 def test_Element_findall():
     child_1 = Element(u'b1')
     child_2 = Element(u'b2')
@@ -143,6 +130,19 @@
     assert len(result) == 1
     assert result[0] is child_1
 
+def test_Element_findtext_default():
+    elem = Element(u'a')
+    default_text = u'defaulttext'
+    result = elem.findtext(u'doesnotexist', default=default_text)
+    assert result is default_text
+
+def test_Element_findtext():
+    child_text = u"text"
+    child = Element(u'b', children=(child_text, ))
+    elem = Element(u'a', children=(child, ))
+    result = elem.findtext(u'b')
+    assert result is child_text
+
 def test_Element_clear():
     pass