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

Method test_copy

Lib/test/test_xml_etree.py:434–444  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

432 self.assertLess(len(ElementPath._cache), 500)
433
434 def test_copy(self):
435 # Test copy handling (etc).
436
437 import copy
438 e1 = ET.XML("<tag>hello<foo/></tag>")
439 e2 = copy.copy(e1)
440 e3 = copy.deepcopy(e1)
441 e1.find("foo").tag = "bar"
442 self.serialize_check(e1, '<tag>hello<bar /></tag>')
443 self.serialize_check(e2, '<tag>hello<bar /></tag>')
444 self.serialize_check(e3, '<tag>hello<foo /></tag>')
445
446 def test_attrib(self):
447 # Test attribute handling.

Callers

nothing calls this directly

Calls 3

serialize_checkMethod · 0.95
copyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected