summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_array.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-03-13 18:18:51 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-03-13 18:18:51 (GMT)
commit3aa82c07f709a532de28a39308c23757d3b9c91b (patch)
tree9afcb4a3e014ee23daac39f38f45cb3b21811345 /Lib/test/test_array.py
parent42bec93e5c0fd114b2f4c3c498b35001d97a94c4 (diff)
downloadcpython-3aa82c07f709a532de28a39308c23757d3b9c91b.zip
cpython-3aa82c07f709a532de28a39308c23757d3b9c91b.tar.gz
cpython-3aa82c07f709a532de28a39308c23757d3b9c91b.tar.bz2
SF bug #910986: copy.copy fails for array.array
Added support for the copy module.
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-xLib/test/test_array.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 0331280..c9b05c2 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -73,6 +73,13 @@ class BaseTest(unittest.TestCase):
b.byteswap()
self.assertEqual(a, b)
+ def test_copy(self):
+ import copy
+ a = array.array(self.typecode, self.example)
+ b = copy.copy(a)
+ self.assertNotEqual(id(a), id(b))
+ self.assertEqual(a, b)
+
def test_insert(self):
a = array.array(self.typecode, self.example)
a.insert(0, self.example[0])