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

Method testCloneDocumentTypeDeepOk

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

Source from the content-addressed store, hash-verified

837 self.assertFalse(doc.doctype.isSameNode(doc2.doctype))
838
839 def testCloneDocumentTypeDeepOk(self):
840 doctype = create_nonempty_doctype()
841 clone = doctype.cloneNode(1)
842 self.confirm(clone is not None
843 and clone.nodeName == doctype.nodeName
844 and clone.name == doctype.name
845 and clone.publicId == doctype.publicId
846 and clone.systemId == doctype.systemId
847 and len(clone.entities) == len(doctype.entities)
848 and clone.entities.item(len(clone.entities)) is None
849 and len(clone.notations) == len(doctype.notations)
850 and clone.notations.item(len(clone.notations)) is None
851 and len(clone.childNodes) == 0)
852 for i in range(len(doctype.entities)):
853 se = doctype.entities.item(i)
854 ce = clone.entities.item(i)
855 self.confirm((not se.isSameNode(ce))
856 and (not ce.isSameNode(se))
857 and ce.nodeName == se.nodeName
858 and ce.notationName == se.notationName
859 and ce.publicId == se.publicId
860 and ce.systemId == se.systemId
861 and ce.encoding == se.encoding
862 and ce.actualEncoding == se.actualEncoding
863 and ce.version == se.version)
864 for i in range(len(doctype.notations)):
865 sn = doctype.notations.item(i)
866 cn = clone.notations.item(i)
867 self.confirm((not sn.isSameNode(cn))
868 and (not cn.isSameNode(sn))
869 and cn.nodeName == sn.nodeName
870 and cn.publicId == sn.publicId
871 and cn.systemId == sn.systemId)
872
873 def testCloneDocumentTypeDeepNotOk(self):
874 doc = create_doc_with_doctype()

Callers

nothing calls this directly

Calls 5

confirmMethod · 0.95
create_nonempty_doctypeFunction · 0.85
isSameNodeMethod · 0.80
cloneNodeMethod · 0.45
itemMethod · 0.45

Tested by

no test coverage detected