Lines Matching full:copy
1 """Unit tests for the copy module."""
3 import copy
12 # Attempt full line coverage of copy.py from top to bottom
15 self.assertTrue(copy.Error is copy.error)
16 self.assertTrue(issubclass(copy.Error, Exception))
18 # The copy() method
22 y = copy.copy(x)
32 y = copy.copy(x)
45 self.assertRaises(TypeError, copy.copy, x)
47 y = copy.copy(x)
56 y = copy.copy(x)
64 y = copy.copy(x)
74 self.assertRaises(copy.Error, copy.copy, x)
90 self.assertTrue(copy.copy(x) is x, repr(x))
94 y = copy.copy(x)
98 y = copy.copy(x)
104 self.assertIs(copy.copy(x), x)
106 self.assertIs(copy.copy(x), x)
108 self.assertIs(copy.copy(x), x)
112 y = copy.copy(x)
116 y = copy.copy(x)
122 y = copy.copy(x)
126 y = copy.copy(x)
132 self.assertIs(copy.copy(x), x)
134 self.assertIs(copy.copy(x), x)
138 y = copy.copy(x)
142 y = copy.copy(x)
153 self.assertEqual(copy.copy(x), x)
164 self.assertEqual(copy.copy(x), x)
175 self.assertEqual(copy.copy(x), x)
186 self.assertEqual(copy.copy(x), x)
197 self.assertEqual(copy.copy(x), x)
210 self.assertEqual(copy.copy(x), x)
213 self.assertEqual(copy.copy(x), x)
219 y = copy.deepcopy(x)
227 y = copy.deepcopy(x)
242 self.assertEqual(copy.deepcopy(C), C)
251 y = copy.deepcopy(x)
264 self.assertRaises(TypeError, copy.deepcopy, x)
266 y = copy.deepcopy(x)
275 y = copy.deepcopy(x)
283 y = copy.deepcopy(x)
293 self.assertRaises(copy.Error, copy.deepcopy, x)
308 self.assertTrue(copy.deepcopy(x) is x, repr(x))
312 y = copy.deepcopy(x)
320 y = copy.deepcopy(x)
328 y = copy.deepcopy(x)
336 y = copy.deepcopy(x)
344 y = copy.deepcopy(x)
352 y = copy.deepcopy(x)
361 y = copy.deepcopy(x, memo)
371 y = copy.deepcopy(x)
380 return C(copy.deepcopy(self.foo, memo))
384 y = copy.deepcopy(x)
398 y = copy.deepcopy(x)
412 y = copy.deepcopy(x)
426 y = copy.deepcopy(x)
442 y = copy.deepcopy(x)
448 y = copy.deepcopy(x)
458 y = copy.deepcopy(x)
469 y = copy.copy(x)
471 y = copy.deepcopy(x)
480 y = copy.copy(x)
482 y = copy.deepcopy(x)
494 y = copy.copy(x)
496 y = copy.deepcopy(x)
511 y = copy.copy(x)
513 y = copy.deepcopy(x)
522 y = copy.deepcopy(x)
537 y = copy.copy(x)
541 y = copy.deepcopy(x)
555 y = copy.copy(x)
559 y = copy.deepcopy(x)
569 y = copy.copy(x)
577 y = copy.deepcopy(x)
593 y = copy.deepcopy(x)
606 y = copy.copy(x)
617 y = copy.deepcopy(x)
628 y = copy.copy(x)
636 y = copy.deepcopy(x)
645 self.assertRaises(ValueError, copy.copy, EvilState())
648 self.assertEqual(copy.copy(global_foo), global_foo)
650 self.assertEqual(copy.copy(foo), foo)
652 self.assertEqual(copy.copy(bar), bar)
655 self.assertEqual(copy.deepcopy(global_foo), global_foo)
657 self.assertEqual(copy.deepcopy(foo), foo)
659 self.assertEqual(copy.deepcopy(bar), bar)
673 self._check_weakref(copy.copy)
676 self._check_weakref(copy.deepcopy)
685 v = copy.copy(u)
713 v = copy.deepcopy(u)
732 v = copy.deepcopy(u)
752 g = copy.deepcopy(f)