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

Method testCloneDocumentTypeDeepOk

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected