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

Method _copy_test

Lib/test/test_collections.py:43–54  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

41 )
42
43 def _copy_test(self, obj):
44 # Test internal copy
45 obj_copy = obj.copy()
46 self.assertIsNot(obj.data, obj_copy.data)
47 self.assertEqual(obj.data, obj_copy.data)
48
49 # Test copy.copy
50 obj.test = [1234] # Make sure instance vars are also copied.
51 obj_copy = copy.copy(obj)
52 self.assertIsNot(obj.data, obj_copy.data)
53 self.assertEqual(obj.data, obj_copy.data)
54 self.assertIs(obj.test, obj_copy.test)
55
56 def test_str_protocol(self):
57 self._superset_test(UserString, str)

Callers 2

test_list_copyMethod · 0.95
test_dict_copyMethod · 0.95

Calls 4

assertIsNotMethod · 0.80
copyMethod · 0.45
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected