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

Method _setupCloneElement

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

Source from the content-addressed store, hash-verified

778 self.assertIs(a2.ownerElement, e2)
779
780 def _setupCloneElement(self, deep):
781 dom = parseString("<doc attr='value'><foo/></doc>")
782 root = dom.documentElement
783 clone = root.cloneNode(deep)
784 self._testCloneElementCopiesAttributes(
785 root, clone, "testCloneElement" + (deep and "Deep" or "Shallow"))
786 # mutilate the original so shared data is detected
787 root.tagName = root.nodeName = "MODIFIED"
788 root.setAttribute("attr", "NEW VALUE")
789 root.setAttribute("added", "VALUE")
790 return dom, clone
791
792 @unittest.expectedFailure # TODO: RUSTPYTHON
793 def testCloneElementShallow(self):

Callers 2

testCloneElementDeepMethod · 0.95

Calls 4

parseStringFunction · 0.90
setAttributeMethod · 0.80
cloneNodeMethod · 0.45

Tested by

no test coverage detected