Backport test cases added in r73852.

This commit is contained in:
Alexandre Vassalotti 2009-07-05 06:33:41 +00:00
parent 16a0247393
commit 5b1abb7bb0
1 changed files with 13 additions and 0 deletions

View File

@ -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)