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

Method check_clone_attribute

Lib/test/test_minidom.py:930–942  ·  view source on GitHub ↗
(self, deep, testName)

Source from the content-addressed store, hash-verified

928 # Testing attribute clones uses a helper, and should always be deep,
929 # even if the argument to cloneNode is false.
930 def check_clone_attribute(self, deep, testName):
931 doc = parseString("<doc attr='value'/>")
932 attr = doc.documentElement.getAttributeNode("attr")
933 self.assertIsNotNone(attr)
934 clone = attr.cloneNode(deep)
935 self.assertFalse(clone.isSameNode(attr))
936 self.assertFalse(attr.isSameNode(clone))
937 self.assertIsNone(clone.ownerElement,
938 testName + ": ownerElement should be None")
939 self.confirm(clone.ownerDocument.isSameNode(attr.ownerDocument),
940 testName + ": ownerDocument does not match")
941 self.confirm(clone.specified,
942 testName + ": cloned attribute must have specified == True")
943
944 @unittest.expectedFailure # TODO: RUSTPYTHON
945 def testCloneAttributeShallow(self):

Callers 2

Calls 8

confirmMethod · 0.95
parseStringFunction · 0.90
getAttributeNodeMethod · 0.80
assertIsNotNoneMethod · 0.80
assertFalseMethod · 0.80
isSameNodeMethod · 0.80
assertIsNoneMethod · 0.80
cloneNodeMethod · 0.45

Tested by

no test coverage detected