MCPcopy Index your code
hub / github.com/python/cpython / testWholeText

Method testWholeText

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

Source from the content-addressed store, hash-verified

1456 doc.unlink()
1457
1458 def testWholeText(self):
1459 doc = parseString("<doc>a</doc>")
1460 elem = doc.documentElement
1461 text = elem.childNodes[0]
1462 self.assertEqual(text.nodeType, Node.TEXT_NODE)
1463
1464 self.checkWholeText(text, "a")
1465 elem.appendChild(doc.createTextNode("b"))
1466 self.checkWholeText(text, "ab")
1467 elem.insertBefore(doc.createCDATASection("c"), text)
1468 self.checkWholeText(text, "cab")
1469
1470 # make sure we don't cross other nodes
1471 splitter = doc.createComment("comment")
1472 elem.appendChild(splitter)
1473 text2 = doc.createTextNode("d")
1474 elem.appendChild(text2)
1475 self.checkWholeText(text, "cab")
1476 self.checkWholeText(text2, "d")
1477
1478 x = doc.createElement("x")
1479 elem.replaceChild(x, splitter)
1480 splitter = x
1481 self.checkWholeText(text, "cab")
1482 self.checkWholeText(text2, "d")
1483
1484 x = doc.createProcessingInstruction("y", "z")
1485 elem.replaceChild(x, splitter)
1486 splitter = x
1487 self.checkWholeText(text, "cab")
1488 self.checkWholeText(text2, "d")
1489
1490 elem.removeChild(splitter)
1491 self.checkWholeText(text, "cabd")
1492 self.checkWholeText(text2, "cabd")
1493
1494 def testPatch1094164(self):
1495 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