summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_array.py
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2009-07-05 06:33:41 (GMT)
committerAlexandre Vassalotti <alexandre@peadrop.com>2009-07-05 06:33:41 (GMT)
commit5b1abb7bb0553c0f9ed41bf75d1003eb47a86013 (patch)
tree01ac8a11d023a4120cef4a1762af2624e1422cda /Lib/test/test_array.py
parent16a024739328b8a026b6ac3619c9b74047079a5f (diff)
downloadcpython-5b1abb7bb0553c0f9ed41bf75d1003eb47a86013.zip
cpython-5b1abb7bb0553c0f9ed41bf75d1003eb47a86013.tar.gz
cpython-5b1abb7bb0553c0f9ed41bf75d1003eb47a86013.tar.bz2
Backport test cases added in r73852.
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-xLib/test/test_array.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 6433935..0ef5f9e 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -278,6 +278,12 @@ class BaseTest(unittest.TestCase):
a,
array.array(self.typecode, self.example[::-1]+2*self.example)
)
+ a = array.array(self.typecode, self.example)
+ a += a
+ self.assertEqual(
+ a,
+ array.array(self.typecode, self.example + self.example)
+ )
b = array.array(self.badtypecode())
self.assertRaises(TypeError, a.__add__, b)
@@ -675,6 +681,13 @@ class BaseTest(unittest.TestCase):
array.array(self.typecode, self.example+self.example[::-1])
)
+ a = array.array(self.typecode, self.example)
+ a.extend(a)
+ self.assertEqual(
+ a,
+ array.array(self.typecode, self.example+self.example)
+ )
+
b = array.array(self.badtypecode())
self.assertRaises(TypeError, a.extend, b)