[4suite-checkins] In Amara/test/bindery, files realworld.py

Uche Ogbuji uogbuji at 4suite.org
Sun Jun 3 09:36:59 MDT 2007


Modified Files:
    realworld.py

Log Message:
Fix bindery bugs with __delattr__, and with elements named None:
* http://lists.fourthought.com/pipermail/4suite/2007-June/008276.html
* http://lists.fourthought.com/pipermail/4suite/2007-June/008277.html

ViewCVS diff:
  http://cvs.4suite.org/viewcvs/Amara/test/bindery/realworld.py.diff?r1=1.17&r2=1.18
ViewCVS view:
  http://cvs.4suite.org/viewcvs/Amara/test/bindery/realworld.py?rev=1.18&content-type=text/vnd.viewcvs-markup

Index: realworld.py
===================================================================
RCS file: /var/local/cvsroot/Amara/test/bindery/realworld.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -U 2 -r1.17 -r1.18
--- realworld.py	15 Dec 2006 07:44:30 -0000	1.17
+++ realworld.py	3 Jun 2007 15:36:58 -0000	1.18
@@ -8,4 +8,6 @@
 from Ft.Lib import Uri
 
+XMLDECL = '<?xml version="1.0" encoding="UTF-8"?>\n'
+
 
 class TestBase(unittest.TestCase):
@@ -351,6 +353,4 @@
         return
 
-XMLDECL = '<?xml version="1.0" encoding="UTF-8"?>\n'
-
 class TestJN050418(TestBase):
     #From Jamie Norrish
@@ -634,4 +634,42 @@
 
 
+class TestLM050319(TestBase):
+    #Luis Morillas reported bug deleting elements
+    XML = """<?xml version="1.0" encoding="utf-8"?>
+    <a>
+      <b>
+        <c>
+          <d>text d</d>
+        </c>
+        <c>
+          <e>text e</e>
+        </c>
+        <c>
+          <f>text f</f>
+        </c>
+      </b>
+    </a>
+    """
+    
+    EXPECTED = XMLDECL + """<a>
+      <b>
+        
+        <c>
+          <e>text e</e>
+        </c>
+        <c>
+          <f>text f</f>
+        </c>
+      </b>
+    </a>"""
+    
+    def testDeleteElement(self):
+        import amara
+        doc = amara.parse(self.XML)
+        del doc.a.b.c
+        self.assertEqual(doc.xml(), self.EXPECTED)
+        return
+
+
 if __name__ == '__main__':
     unittest.main()


More information about the 4suite-checkins mailing list