diff -r 4348fb8cae27 Lib/test/test_collections.py --- a/Lib/test/test_collections.py Fri May 27 12:56:41 2016 -0600 +++ b/Lib/test/test_collections.py Sat May 28 15:06:28 2016 +0300 @@ -38,6 +38,18 @@ b=b.__name__, ), ) + + def _copy_test(self, obj): + # Test internal copy + obj_copy = obj.copy() + self.assertIsNot(obj.data, obj_copy.data) + self.assertEqual(obj.data, obj_copy.data) + + # Test copy.copy + obj_copy = copy.copy(obj) + self.assertIsNot(obj.data, obj_copy.data) + self.assertEqual(obj.data, obj_copy.data) + def test_str_protocol(self): self._superset_test(UserString, str) @@ -47,6 +59,17 @@ def test_dict_protocol(self): self._superset_test(UserDict, dict) + def test_list_copy(self): + obj = UserList() + obj.append(123) + self._copy_test(obj) + + @unittest.skip("Under implementation") + def test_dict_copy(self): + obj = UserDict() + obj[123] = "abc" + self._copy_test(obj) + ################################################################################ ### ChainMap (helper class for configparser and the string module)