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

Method _setupCloneElement

Lib/test/test_minidom.py:773–783  ·  view source on GitHub ↗
(self, deep)

Source from the content-addressed store, hash-verified

771 self.assertIs(a2.ownerElement, e2)
772
773 def _setupCloneElement(self, deep):
774 dom = parseString("<doc attr='value'><foo/></doc>")
775 root = dom.documentElement
776 clone = root.cloneNode(deep)
777 self._testCloneElementCopiesAttributes(
778 root, clone, "testCloneElement" + (deep and "Deep" or "Shallow"))
779 # mutilate the original so shared data is detected
780 root.tagName = root.nodeName = "MODIFIED"
781 root.setAttribute("attr", "NEW VALUE")
782 root.setAttribute("added", "VALUE")
783 return dom, clone
784
785 def testCloneElementShallow(self):
786 dom, clone = self._setupCloneElement(0)

Callers 2

testCloneElementDeepMethod · 0.95

Calls 4

parseStringFunction · 0.90
setAttributeMethod · 0.80
cloneNodeMethod · 0.45

Tested by

no test coverage detected