Skip to content

Commit

Permalink
test reshape function of buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
wlav committed Oct 18, 2017
1 parent 3ff9968 commit b431ee1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/test_datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,13 @@ def test19_buffer_reshaping(self):
'get_long_array', 'get_long_array2',
'get_ulong_array', 'get_ulong_array2']:
arr = getattr(c, func)()
arr = arr.shape.fromaddress(arr.itemaddress(0), self.N)
arr.reshape((self.N,))
assert len(arr) == self.N

raises(TypeError, arr.reshape, (1, 2))
assert len(arr) == self.N

raises(TypeError, arr.reshape, 2*self.N)
assert len(arr) == self.N

l = list(arr)
Expand Down

0 comments on commit b431ee1

Please sign in to comment.