Salome HOME
Tests are now all runnable from BUILD dir only with no install.
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingNumPyTest.py
index 6a622128587bb747640f3fa0981484d0a941c01d..e5d7943bf1531970fb5d94b28e9c0a2626e29642 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -656,6 +656,14 @@ class MEDCouplingNumPyTest(unittest.TestCase):
         self.assertEqual(a2.tolist(),[[0.,1.,2.],[3.,4.,5.],[6.,7.,8.],[9.,10.,11.],[12.,13.,14.]])
         pass
 
+    @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
+    def test27(self):
+        m0=DenseMatrix(DataArrayDouble([2,3,4,5,1,6]),2,3)
+        m0np=m0.toNumPyMatrix()
+        self.assertEqual(m0np.shape,(2,3))
+        self.assertEqual(m0np.tolist(),[[2.0,3.0,4.0],[5.0,1.0,6.0]])
+        pass
+
     def setUp(self):
         pass
     pass