Skip to content

Commit 7467526

Browse files
assertFalse
1 parent 9b0b74f commit 7467526

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
@@ -155,7 +155,7 @@ def _create_fragment_test_nodes(self):
155155
def testInsertBeforeFragment(self):
156156
dom, orig, c1, c2, c3, frag = self._create_fragment_test_nodes()
157157
dom.documentElement.insertBefore(frag, None)
158-
self.assertEqual(tuple(dom.documentElement.childNodes),
158+
self.assertTupleEqual(tuple(dom.documentElement.childNodes),
159159
(orig, c1, c2, c3),
160160
"insertBefore(<fragment>, None)")
161161
frag.unlink()
@@ -221,9 +221,9 @@ def testNamedNodeMapSetItem(self):
221221
attrs = elem.attributes
222222
attrs["foo"] = "bar"
223223
a = attrs.item(0)
224-
self.assertTrue(a.ownerDocument is dom,
224+
self.assertIs(a.ownerDocument, dom,
225225
"NamedNodeMap.__setitem__() sets ownerDocument")
226-
self.assertTrue(a.ownerElement is elem,
226+
self.assertIs(a.ownerElement, elem,
227227
"NamedNodeMap.__setitem__() sets ownerElement")
228228
self.assertEqual(a.value, "bar",
229229
"NamedNodeMap.__setitem__() sets value")
@@ -234,9 +234,9 @@ def testNamedNodeMapSetItem(self):
234234

235235
def testNonZero(self):
236236
dom = parse(tstfile)
237-
self.assertTrue(dom)# should not be zero
237+
self.assertTrue(dom) # should not be zero
238238
dom.appendChild(dom.createComment("foo"))
239-
self.assertTrue(not dom.childNodes[-1].childNodes)
239+
self.assertFalse(dom.childNodes[-1].childNodes)
240240
dom.unlink()
241241

242242
def testUnlink(self):
@@ -758,22 +758,22 @@ def testCloneDocumentDeep(self):
758758
"]>\n"
759759
"<doc attr='value'/>")
760760
doc2 = doc.cloneNode(1)
761-
self.assertTrue(not (doc.isSameNode(doc2) or doc2.isSameNode(doc)),
761+
self.assertFalse((doc.isSameNode(doc2) or doc2.isSameNode(doc)),
762762
"testCloneDocumentDeep: document objects not distinct")
763763
self.assertEqual(len(doc.childNodes), len(doc2.childNodes),
764764
"testCloneDocumentDeep: wrong number of Document children")
765765
self.assertEqual(doc2.documentElement.nodeType, Node.ELEMENT_NODE,
766766
"testCloneDocumentDeep: documentElement not an ELEMENT_NODE")
767767
self.assertTrue(doc2.documentElement.ownerDocument.isSameNode(doc2),
768768
"testCloneDocumentDeep: documentElement owner is not new document")
769-
self.assertTrue(not doc.documentElement.isSameNode(doc2.documentElement),
769+
self.assertFalse(doc.documentElement.isSameNode(doc2.documentElement),
770770
"testCloneDocumentDeep: documentElement should not be shared")
771771
if doc.doctype is not None:
772772
# check the doctype iff the original DOM maintained it
773773
self.assertEqual(doc2.doctype.nodeType, Node.DOCUMENT_TYPE_NODE,
774774
"testCloneDocumentDeep: doctype not a DOCUMENT_TYPE_NODE")
775775
self.assertTrue(doc2.doctype.ownerDocument.isSameNode(doc2))
776-
self.assertTrue(not doc.doctype.isSameNode(doc2.doctype))
776+
self.assertFalse(doc.doctype.isSameNode(doc2.doctype))
777777

778778
def testCloneDocumentTypeDeepOk(self):
779779
doctype = create_nonempty_doctype()
@@ -863,8 +863,8 @@ def check_clone_attribute(self, deep, testName):
863863
attr = doc.documentElement.getAttributeNode("attr")
864864
self.assertNotEqual(attr, None)
865865
clone = attr.cloneNode(deep)
866-
self.assertTrue(not clone.isSameNode(attr))
867-
self.assertTrue(not attr.isSameNode(clone))
866+
self.assertFalse(clone.isSameNode(attr))
867+
self.assertFalse(attr.isSameNode(clone))
868868
self.assertIs(clone.ownerElement, None,
869869
testName + ": ownerElement should be None")
870870
self.confirm(clone.ownerDocument.isSameNode(attr.ownerDocument),
@@ -1559,9 +1559,9 @@ def testSetIdAttributeNS(self):
15591559
a3.value = "v"
15601560
e.setAttributeNode(a3)
15611561
self.assertTrue(e.isSameNode(doc.getElementById("w")))
1562-
self.assertTrue(not a1.isId)
1562+
self.assertFalse(a1.isId)
15631563
self.assertTrue(a2.isId)
1564-
self.assertTrue(not a3.isId)
1564+
self.assertFalse(a3.isId)
15651565
self.assertIs(doc.getElementById("v"), None)
15661566
# renaming an attribute should not affect its ID-ness:
15671567
doc.renameNode(a2, xml.dom.EMPTY_NAMESPACE, "an")
@@ -1595,9 +1595,9 @@ def testSetIdAttributeNode(self):
15951595
a3.value = "v"
15961596
e.setAttributeNode(a3)
15971597
self.assertTrue(e.isSameNode(doc.getElementById("w")))
1598-
self.assertTrue(not a1.isId)
1598+
self.assertFalse(a1.isId)
15991599
self.assertTrue(a2.isId)
1600-
self.assertTrue(not a3.isId)
1600+
self.assertFalse(a3.isId)
16011601
self.assertIs(doc.getElementById("v"), None)
16021602
# renaming an attribute should not affect its ID-ness:
16031603
doc.renameNode(a2, xml.dom.EMPTY_NAMESPACE, "an")

0 commit comments

Comments
 (0)