Follow PyXML: Remove all prints from successful tests. This means we can

also drop the output file.
This commit is contained in:
Fred Drake 2002-07-19 22:16:41 +00:00
parent 814f9fe806
commit c441f7b3a6
2 changed files with 14 additions and 241 deletions

View File

@ -1,220 +0,0 @@
test_minidom
Passed testAAA
Passed setAttribute() sets ownerDocument
Passed setAttribute() sets ownerElement
Test Succeeded testAAA
Passed assertion: len(Node.allnodes) == 0
Passed testAAB
Test Succeeded testAAB
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Passed Test
Passed Test
Passed Test
Passed Test
Passed Test
Passed Test
Test Succeeded testAddAttr
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testAppendChild
Passed assertion: len(Node.allnodes) == 0
Passed appendChild(<fragment>)
Test Succeeded testAppendChildFragment
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testAttrListItem
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testAttrListItemNS
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testAttrListItems
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testAttrListKeys
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testAttrListKeysNS
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testAttrListLength
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testAttrListValues
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testAttrList__getitem__
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testAttrList__setitem__
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testAttributeRepr
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Passed Test
Passed Test
Passed Test
Test Succeeded testChangeAttr
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testChildNodes
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCloneAttributeDeep
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCloneAttributeShallow
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCloneDocumentDeep
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCloneDocumentShallow
Passed assertion: len(Node.allnodes) == 0
Passed clone of element has same attribute keys
Passed clone of attribute node has proper attribute values
Passed clone of attribute node correctly owned
Passed testCloneElementDeep
Test Succeeded testCloneElementDeep
Passed assertion: len(Node.allnodes) == 0
Passed clone of element has same attribute keys
Passed clone of attribute node has proper attribute values
Passed clone of attribute node correctly owned
Passed testCloneElementShallow
Test Succeeded testCloneElementShallow
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testClonePIDeep
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testClonePIShallow
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testComment
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCreateAttributeNS
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testCreateElementNS
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Passed Test
Test Succeeded testDeleteAttr
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testDocumentElement
Passed assertion: len(Node.allnodes) == 0
Passed Test
Test Succeeded testElement
Passed assertion: len(Node.allnodes) == 0
Passed Test
Test Succeeded testElementReprAndStr
Passed assertion: len(Node.allnodes) == 0
Passed testEncodings - encoding EURO SIGN
Test Succeeded testEncodings
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testFirstChild
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testGetAttrLength
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testGetAttrList
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testGetAttrValues
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testGetAttribute
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testGetAttributeNS
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testGetAttributeNode
Passed assertion: len(Node.allnodes) == 0
Passed Test
Test Succeeded testGetElementsByTagName
Passed assertion: len(Node.allnodes) == 0
Passed Test
Test Succeeded testGetElementsByTagNameNS
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testGetEmptyNodeListFromElementsByTagNameNS
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testHasChildNodes
Passed assertion: len(Node.allnodes) == 0
Passed testInsertBefore -- node properly placed in tree
Passed testInsertBefore -- node properly placed in tree
Passed testInsertBefore -- node properly placed in tree
Test Succeeded testInsertBefore
Passed assertion: len(Node.allnodes) == 0
Passed insertBefore(<fragment>, None)
Passed insertBefore(<fragment>, orig)
Test Succeeded testInsertBeforeFragment
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testLegalChildren
Passed assertion: len(Node.allnodes) == 0
Passed NamedNodeMap.__setitem__() sets ownerDocument
Passed NamedNodeMap.__setitem__() sets ownerElement
Passed NamedNodeMap.__setitem__() sets value
Passed NamedNodeMap.__setitem__() sets nodeValue
Test Succeeded testNamedNodeMapSetItem
Passed assertion: len(Node.allnodes) == 0
Passed test NodeList.item()
Test Succeeded testNodeListItem
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testNonZero
Passed assertion: len(Node.allnodes) == 0
Passed testNormalize -- preparation
Passed testNormalize -- result
Passed testNormalize -- single empty node removed
Test Succeeded testNormalize
Passed assertion: len(Node.allnodes) == 0
Passed testParents
Test Succeeded testParents
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testParse
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testParseAttributeNamespaces
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testParseAttributes
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testParseElement
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testParseElementNamespaces
Passed assertion: len(Node.allnodes) == 0
Passed Test
Test Succeeded testParseFromFile
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testParseProcessingInstructions
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testParseString
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testProcessingInstruction
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testProcessingInstructionRepr
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testRemoveAttr
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testRemoveAttrNS
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testRemoveAttributeNode
Passed assertion: len(Node.allnodes) == 0
Passed replaceChild(<fragment>)
Test Succeeded testReplaceChildFragment
Passed assertion: len(Node.allnodes) == 0
Passed testSAX2DOM - siblings
Passed testSAX2DOM - parents
Test Succeeded testSAX2DOM
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testSetAttrValueandNodeValue
Passed assertion: len(Node.allnodes) == 0
Passed testSiblings
Test Succeeded testSiblings
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testTextNodeRepr
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testTextRepr
Passed assertion: len(Node.allnodes) == 0
Caught expected exception when adding extra document element.
Test Succeeded testTooManyDocumentElements
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testUnlink
Passed assertion: len(Node.allnodes) == 0
Test Succeeded testWriteText
Passed assertion: len(Node.allnodes) == 0
Passed Test
Passed Test
Test Succeeded testWriteXML
Passed assertion: len(Node.allnodes) == 0
All tests succeeded

View File

@ -1,14 +1,16 @@
# test for xml.dom.minidom # test for xml.dom.minidom
from xml.dom.minidom import parse, Node, Document, parseString
from xml.dom import HierarchyRequestErr
import xml.parsers.expat
import os import os
import sys import sys
import traceback import traceback
from test_support import verbose from test_support import verbose
import xml.dom
import xml.parsers.expat
from xml.dom.minidom import parse, Node, Document, parseString
if __name__ == "__main__": if __name__ == "__main__":
base = sys.argv[0] base = sys.argv[0]
else: else:
@ -17,9 +19,7 @@ tstfile = os.path.join(os.path.dirname(base), "test"+os.extsep+"xml")
del base del base
def confirm(test, testname = "Test"): def confirm(test, testname = "Test"):
if test: if not test:
print "Passed " + testname
else:
print "Failed " + testname print "Failed " + testname
raise Exception raise Exception
@ -137,29 +137,29 @@ def testLegalChildren():
text = dom.createTextNode('text') text = dom.createTextNode('text')
try: dom.appendChild(text) try: dom.appendChild(text)
except HierarchyRequestErr: pass except xml.dom.HierarchyRequestErr: pass
else: else:
print "dom.appendChild didn't raise HierarchyRequestErr" print "dom.appendChild didn't raise HierarchyRequestErr"
dom.appendChild(elem) dom.appendChild(elem)
try: dom.insertBefore(text, elem) try: dom.insertBefore(text, elem)
except HierarchyRequestErr: pass except xml.dom.HierarchyRequestErr: pass
else: else:
print "dom.appendChild didn't raise HierarchyRequestErr" print "dom.appendChild didn't raise HierarchyRequestErr"
try: dom.replaceChild(text, elem) try: dom.replaceChild(text, elem)
except HierarchyRequestErr: pass except xml.dom.HierarchyRequestErr: pass
else: else:
print "dom.appendChild didn't raise HierarchyRequestErr" print "dom.appendChild didn't raise HierarchyRequestErr"
nodemap = elem.attributes nodemap = elem.attributes
try: nodemap.setNamedItem(text) try: nodemap.setNamedItem(text)
except HierarchyRequestErr: pass except xml.dom.HierarchyRequestErr: pass
else: else:
print "NamedNodeMap.setNamedItem didn't raise HierarchyRequestErr" print "NamedNodeMap.setNamedItem didn't raise HierarchyRequestErr"
try: nodemap.setNamedItemNS(text) try: nodemap.setNamedItemNS(text)
except HierarchyRequestErr: pass except xml.dom.HierarchyRequestErr: pass
else: else:
print "NamedNodeMap.setNamedItemNS didn't raise HierarchyRequestErr" print "NamedNodeMap.setNamedItemNS didn't raise HierarchyRequestErr"
@ -388,8 +388,8 @@ def testTooManyDocumentElements():
elem = doc.createElement("extra") elem = doc.createElement("extra")
try: try:
doc.appendChild(elem) doc.appendChild(elem)
except HierarchyRequestErr: except xml.dom.HierarchyRequestErr:
print "Caught expected exception when adding extra document element." pass
else: else:
print "Failed to catch expected exception when" \ print "Failed to catch expected exception when" \
" adding extra document element." " adding extra document element."
@ -626,7 +626,6 @@ for name in names:
func = globals()[name] func = globals()[name]
try: try:
func() func()
print "Test Succeeded", name
confirm(len(Node.allnodes) == 0, confirm(len(Node.allnodes) == 0,
"assertion: len(Node.allnodes) == 0") "assertion: len(Node.allnodes) == 0")
if len(Node.allnodes): if len(Node.allnodes):
@ -650,9 +649,3 @@ if failed:
print "\n\n\n**** Check for failures in these tests:" print "\n\n\n**** Check for failures in these tests:"
for name in failed: for name in failed:
print " " + name print " " + name
print
else:
print "All tests succeeded"
Node.debug = None # Delete debug output collected in a StringIO object
Node._debug = 0 # And reset debug mode