Skip to content

Commit 9b0b74f

Browse files
Fixup
1 parent 0b49e9d commit 9b0b74f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Lib/test/test_minidom.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,32 +102,32 @@ def testInsertBefore(self):
102102
elem = root.childNodes[0]
103103
nelem = dom.createElement("element")
104104
root.insertBefore(nelem, elem)
105-
self.confirm(len(root.childNodes), 2
106-
and root.childNodes.length, 2
105+
self.confirm(len(root.childNodes) == 2
106+
and root.childNodes.length == 2
107107
and root.childNodes[0] is nelem
108108
and root.childNodes.item(0) is nelem
109109
and root.childNodes[1] is elem
110110
and root.childNodes.item(1) is elem
111111
and root.firstChild is nelem
112112
and root.lastChild is elem
113-
and root.toxml(), "<doc><element/><foo/></doc>"
113+
and root.toxml() == "<doc><element/><foo/></doc>"
114114
, "testInsertBefore -- node properly placed in tree")
115115
nelem = dom.createElement("element")
116116
root.insertBefore(nelem, None)
117-
self.confirm(len(root.childNodes), 3
118-
and root.childNodes.length, 3
117+
self.confirm(len(root.childNodes) == 3
118+
and root.childNodes.length == 3
119119
and root.childNodes[1] is elem
120120
and root.childNodes.item(1) is elem
121121
and root.childNodes[2] is nelem
122122
and root.childNodes.item(2) is nelem
123123
and root.lastChild is nelem
124124
and nelem.previousSibling is elem
125-
and root.toxml(), "<doc><element/><foo/><element/></doc>"
125+
and root.toxml() == "<doc><element/><foo/><element/></doc>"
126126
, "testInsertBefore -- node properly placed in tree")
127127
nelem2 = dom.createElement("bar")
128128
root.insertBefore(nelem2, nelem)
129-
self.confirm(len(root.childNodes), 4
130-
and root.childNodes.length, 4
129+
self.confirm(len(root.childNodes) == 4
130+
and root.childNodes.length == 4
131131
and root.childNodes[2] is nelem2
132132
and root.childNodes.item(2) is nelem2
133133
and root.childNodes[3] is nelem
@@ -643,7 +643,7 @@ def testRemoveNamedItem(self):
643643
attrs = e.attributes
644644
a1 = e.getAttributeNode("a")
645645
a2 = attrs.removeNamedItem("a")
646-
self.assertEqual(a1.isSameNode(a2))
646+
self.assertTrue(a1.isSameNode(a2))
647647
self.assertRaises(xml.dom.NotFoundErr, attrs.removeNamedItem, "a")
648648

649649
def testRemoveNamedItemNS(self):
@@ -764,7 +764,7 @@ def testCloneDocumentDeep(self):
764764
"testCloneDocumentDeep: wrong number of Document children")
765765
self.assertEqual(doc2.documentElement.nodeType, Node.ELEMENT_NODE,
766766
"testCloneDocumentDeep: documentElement not an ELEMENT_NODE")
767-
self.assertEqual(doc2.documentElement.ownerDocument.isSameNode(doc2),
767+
self.assertTrue(doc2.documentElement.ownerDocument.isSameNode(doc2),
768768
"testCloneDocumentDeep: documentElement owner is not new document")
769769
self.assertTrue(not doc.documentElement.isSameNode(doc2.documentElement),
770770
"testCloneDocumentDeep: documentElement should not be shared")
@@ -867,10 +867,10 @@ def check_clone_attribute(self, deep, testName):
867867
self.assertTrue(not attr.isSameNode(clone))
868868
self.assertIs(clone.ownerElement, None,
869869
testName + ": ownerElement should be None")
870-
self.assertEqual(clone.ownerDocument.isSameNode(attr.ownerDocument),
870+
self.confirm(clone.ownerDocument.isSameNode(attr.ownerDocument),
871871
testName + ": ownerDocument does not match")
872-
self.assertEqual(clone.specified,
873-
testName + ": cloned attribute must have specified, True")
872+
self.confirm(clone.specified,
873+
testName + ": cloned attribute must have specified == True")
874874

875875
def testCloneAttributeShallow(self):
876876
self.check_clone_attribute(0, "testCloneAttributeShallow")
@@ -1142,7 +1142,7 @@ def testBug1433694(self):
11421142
node = doc.documentElement
11431143
node.childNodes[1].nodeValue = ""
11441144
node.normalize()
1145-
self.assertIS(node.childNodes[-1].nextSibling, None,
1145+
self.assertIs(node.childNodes[-1].nextSibling, None,
11461146
"Final child's .nextSibling should be None")
11471147

11481148
def testSiblings(self):

0 commit comments

Comments
 (0)