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

Method check_clone_attribute

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

Source from the content-addressed store, hash-verified

920 # Testing attribute clones uses a helper, and should always be deep,
921 # even if the argument to cloneNode is false.
922 def check_clone_attribute(self, deep, testName):
923 doc = parseString("<doc attr='value'/>")
924 attr = doc.documentElement.getAttributeNode("attr")
925 self.assertIsNotNone(attr)
926 clone = attr.cloneNode(deep)
927 self.assertFalse(clone.isSameNode(attr))
928 self.assertFalse(attr.isSameNode(clone))
929 self.assertIsNone(clone.ownerElement,
930 testName + ": ownerElement should be None")
931 self.confirm(clone.ownerDocument.isSameNode(attr.ownerDocument),
932 testName + ": ownerDocument does not match")
933 self.confirm(clone.specified,
934 testName + ": cloned attribute must have specified == True")
935
936 def testCloneAttributeShallow(self):
937 self.check_clone_attribute(0, "testCloneAttributeShallow")

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