shapes.py 554 B

123456789101112131415161718192021
  1. #!/usr/bin/env python
  2. # Copyright Jim Bosch & Ankit Daftery 2010-2012.
  3. # Distributed under the Boost Software License, Version 1.0.
  4. # (See accompanying file LICENSE_1_0.txt or copy at
  5. # http://www.boost.org/LICENSE_1_0.txt)
  6. import shapes_ext
  7. import unittest
  8. import numpy
  9. class TestShapes(unittest.TestCase):
  10. def testShapes(self):
  11. a1 = numpy.array([(0,1),(2,3)])
  12. a1_shape = (1,4)
  13. a1 = shapes_ext.reshape(a1,a1_shape)
  14. self.assertEqual(a1_shape,a1.shape)
  15. if __name__=="__main__":
  16. unittest.main()