MCPcopy Index your code
hub / github.com/RustPython/RustPython / testReplaceWholeText

Method testReplaceWholeText

Lib/test/test_minidom.py:1519–1546  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1517 self.assertIs(e.parentNode, elem, "After replaceChild()")
1518
1519 def testReplaceWholeText(self):
1520 def setup():
1521 doc = parseString("<doc>a<e/>d</doc>")
1522 elem = doc.documentElement
1523 text1 = elem.firstChild
1524 text2 = elem.lastChild
1525 splitter = text1.nextSibling
1526 elem.insertBefore(doc.createTextNode("b"), splitter)
1527 elem.insertBefore(doc.createCDATASection("c"), text1)
1528 return doc, elem, text1, splitter, text2
1529
1530 doc, elem, text1, splitter, text2 = setup()
1531 text = text1.replaceWholeText("new content")
1532 self.checkWholeText(text, "new content")
1533 self.checkWholeText(text2, "d")
1534 self.assertEqual(len(elem.childNodes), 3)
1535
1536 doc, elem, text1, splitter, text2 = setup()
1537 text = text2.replaceWholeText("new content")
1538 self.checkWholeText(text, "new content")
1539 self.checkWholeText(text1, "cab")
1540 self.assertEqual(len(elem.childNodes), 5)
1541
1542 doc, elem, text1, splitter, text2 = setup()
1543 text = text1.replaceWholeText("")
1544 self.checkWholeText(text2, "d")
1545 self.confirm(text is None
1546 and len(elem.childNodes) == 2)
1547
1548 @unittest.expectedFailure # TODO: RUSTPYTHON
1549 def testSchemaType(self):

Callers

nothing calls this directly

Calls 6

checkWholeTextMethod · 0.95
confirmMethod · 0.95
setupFunction · 0.85
lenFunction · 0.85
replaceWholeTextMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected