The usual.
diff --git a/Lib/dos-8x3/test_min.py b/Lib/dos-8x3/test_min.py
index 8a63535..796f6a0 100644
--- a/Lib/dos-8x3/test_min.py
+++ b/Lib/dos-8x3/test_min.py
@@ -1,6 +1,7 @@
# test for xml.dom.minidom
from xml.dom.minidom import parse, Node, Document, parseString
+import xml.parsers.expat
import os.path
import sys
@@ -34,8 +35,6 @@
confirm( dom.getElementsByTagName( "LI" )==\
dom.documentElement.getElementsByTagName( "LI" ) )
dom.unlink()
- dom=None
- confirm (len( Node.allnodes )==0)
def testInsertBefore( ):
dom=parse( tstfile )
@@ -49,9 +48,6 @@
#confirm( docel.childNodes[0].tet=="a" )
#confirm( docel.childNodes[2].tet=="a" )
dom.unlink()
- del dom
- del docel
- confirm( len( Node.allnodes )==0)
def testAppendChild():
dom=parse( tstfile )
@@ -59,8 +55,6 @@
confirm( dom.documentElement.childNodes[-1].nodeName=="#comment" )
confirm( dom.documentElement.childNodes[-1].data=="Hello" )
dom.unlink()
- dom=None
- confirm( len( Node.allnodes )==0 )
def testNonZero():
dom=parse( tstfile )
@@ -68,29 +62,22 @@
dom.appendChild( dom.createComment( "foo" ) )
confirm( not dom.childNodes[-1].childNodes )
dom.unlink()
- dom=None
- confirm( len( Node.allnodes )==0 )
def testUnlink():
dom=parse( tstfile )
dom.unlink()
- dom=None
- confirm( len( Node.allnodes )==0 )
def testElement():
dom=Document()
dom.appendChild( dom.createElement( "abc" ) )
confirm( dom.documentElement )
dom.unlink()
- dom=None
- confirm( len( Node.allnodes )==0 )
def testAAA():
dom=parseString( "<abc/>" )
el=dom.documentElement
el.setAttribute( "spam", "jam2" )
dom.unlink()
- dom=None
def testAAB():
dom=parseString( "<abc/>" )
@@ -98,7 +85,6 @@
el.setAttribute( "spam", "jam" )
el.setAttribute( "spam", "jam2" )
dom.unlink()
- dom=None
def testAddAttr():
dom=Document()
@@ -119,10 +105,7 @@
confirm( child.attributes["def"].value=="newval" )
confirm( len( child.attributes )==2 )
-
dom.unlink()
- dom=None
- child=None
def testDeleteAttr():
dom=Document()
@@ -134,7 +117,6 @@
del child.attributes["def"]
confirm( len( child.attributes)==0 )
dom.unlink()
- confirm( len( Node.allnodes )==0 )
def testRemoveAttr():
dom=Document()
@@ -159,7 +141,6 @@
confirm( len( child.attributes )==1 )
dom.unlink()
- dom=None
def testRemoveAttributeNode():
dom=Document()
@@ -171,8 +152,6 @@
confirm( len( child.attributes )==0 )
dom.unlink()
- dom=None
- confirm( len( Node.allnodes )==0 )
def testChangeAttr():
dom=parseString( "<abc/>" )
@@ -188,8 +167,6 @@
el.attributes[ "spam2"]= "bam2"
confirm( len( el.attributes )==2 )
dom.unlink()
- dom=None
- confirm( len( Node.allnodes )==0 )
def testGetAttrList():
pass
@@ -235,6 +212,7 @@
confirm( string1==string2 )
confirm( string1.find("slash:abc" )!=-1 )
dom.unlink()
+ confirm( len( Node.allnodes )==0 )
def testAttributeRepr():
dom=Document()
@@ -242,10 +220,17 @@
node=el.setAttribute( "abc", "def" )
confirm( str( node ) == repr( node ) )
dom.unlink()
+ confirm( len( Node.allnodes )==0 )
def testTextNodeRepr(): pass
-def testWriteXML(): pass
+def testWriteXML():
+ str = '<a b="c"/>'
+ dom = parseString(str)
+ domstr = dom.toxml()
+ dom.unlink()
+ confirm(str == domstr)
+ confirm( len( Node.allnodes )==0 )
def testProcessingInstruction(): pass
@@ -335,6 +320,8 @@
try:
func()
print "Test Succeeded", name
+ confirm(len(Node.allnodes) == 0,
+ "assertion: len(Node.allnodes) == 0")
if len( Node.allnodes ):
print "Garbage left over:"
if verbose: