(self)
| 2626 | self.assertNotEqual(element_foo.attrib, attrib) |
| 2627 | |
| 2628 | def test___copy__(self): |
| 2629 | element_foo = ET.Element("foo", { "zix": "wyp" }) |
| 2630 | element_foo.append(ET.Element("bar", { "baz": "qix" })) |
| 2631 | |
| 2632 | element_foo2 = copy.copy(element_foo) |
| 2633 | |
| 2634 | # elements are not the same |
| 2635 | self.assertIsNot(element_foo2, element_foo) |
| 2636 | |
| 2637 | # string attributes are equal |
| 2638 | self.assertEqual(element_foo2.tag, element_foo.tag) |
| 2639 | self.assertEqual(element_foo2.text, element_foo.text) |
| 2640 | self.assertEqual(element_foo2.tail, element_foo.tail) |
| 2641 | |
| 2642 | # number of children is the same |
| 2643 | self.assertEqual(len(element_foo2), len(element_foo)) |
| 2644 | |
| 2645 | # children are the same |
| 2646 | for (child1, child2) in itertools.zip_longest(element_foo, element_foo2): |
| 2647 | self.assertIs(child1, child2) |
| 2648 | |
| 2649 | # attrib is a copy |
| 2650 | self.assertEqual(element_foo2.attrib, element_foo.attrib) |
| 2651 | |
| 2652 | def test___deepcopy__(self): |
| 2653 | element_foo = ET.Element("foo", { "zix": "wyp" }) |
nothing calls this directly
no test coverage detected