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

Method testWholeText

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

Source from the content-addressed store, hash-verified

1472 doc.unlink()
1473
1474 def testWholeText(self):
1475 doc = parseString("<doc>a</doc>")
1476 elem = doc.documentElement
1477 text = elem.childNodes[0]
1478 self.assertEqual(text.nodeType, Node.TEXT_NODE)
1479
1480 self.checkWholeText(text, "a")
1481 elem.appendChild(doc.createTextNode("b"))
1482 self.checkWholeText(text, "ab")
1483 elem.insertBefore(doc.createCDATASection("c"), text)
1484 self.checkWholeText(text, "cab")
1485
1486 # make sure we don't cross other nodes
1487 splitter = doc.createComment("comment")
1488 elem.appendChild(splitter)
1489 text2 = doc.createTextNode("d")
1490 elem.appendChild(text2)
1491 self.checkWholeText(text, "cab")
1492 self.checkWholeText(text2, "d")
1493
1494 x = doc.createElement("x")
1495 elem.replaceChild(x, splitter)
1496 splitter = x
1497 self.checkWholeText(text, "cab")
1498 self.checkWholeText(text2, "d")
1499
1500 x = doc.createProcessingInstruction("y", "z")
1501 elem.replaceChild(x, splitter)
1502 splitter = x
1503 self.checkWholeText(text, "cab")
1504 self.checkWholeText(text2, "d")
1505
1506 elem.removeChild(splitter)
1507 self.checkWholeText(text, "cabd")
1508 self.checkWholeText(text2, "cabd")
1509
1510 def testPatch1094164(self):
1511 doc = parseString("<doc><e/></doc>")

Callers

nothing calls this directly

Calls 12

checkWholeTextMethod · 0.95
parseStringFunction · 0.90
createTextNodeMethod · 0.80
createCDATASectionMethod · 0.80
createCommentMethod · 0.80
createElementMethod · 0.80
assertEqualMethod · 0.45
appendChildMethod · 0.45
insertBeforeMethod · 0.45
replaceChildMethod · 0.45
removeChildMethod · 0.45

Tested by

no test coverage detected