Issue #7142: Fix uses of unicode in memoryview objects

This commit is contained in:
Mark Dickinson 2009-10-15 15:53:58 +00:00
parent 196b0925ca
commit 08133af12e
2 changed files with 9 additions and 2 deletions

View file

@ -54,6 +54,12 @@ def test_iter(self):
m = self._view(b)
self.assertEqual(list(m), [m[i] for i in range(len(m))])
def test_repr(self):
for tp in self._types:
b = tp(self._source)
m = self._view(b)
self.assertIsInstance(m.__repr__(), str)
def test_setitem_readonly(self):
if not self.ro_type:
return
@ -156,6 +162,7 @@ def test_compare(self):
def check_attributes_with_type(self, tp):
m = self._view(tp(self._source))
self.assertEquals(m.format, self.format)
self.assertIsInstance(m.format, str)
self.assertEquals(m.itemsize, self.itemsize)
self.assertEquals(m.ndim, 1)
self.assertEquals(m.shape, (6,))