From 9efff108e1d140b8758b567f49237105cc93feeb Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Fri, 28 Apr 2017 07:52:00 +0200 Subject: [PATCH] A little missing test consecutive to 1755dbe71b2fd46cd796464e8 --- src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py b/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py index da14c7b9c..04c55fe8e 100644 --- a/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py +++ b/src/MEDCoupling_Swig/MEDCouplingBasicsTest5.py @@ -4549,6 +4549,22 @@ class MEDCouplingBasicsTest5(unittest.TestCase): self.assertTrue(d.findIdsLowerThan(3).isEqual(DataArrayInt([2,5]))) self.assertTrue(d.findIdsLowerOrEqualTo(3).isEqual(DataArrayInt([2,3,5]))) pass + + def testDAFacto1(self): + """Test focused of new wrapped methods for MEDCouplingFieldInt thanks to code factorization.""" + d=DataArrayDouble(7) ; d.iota() + m=MEDCouplingUMesh.Build1DMeshFromCoords(d) + f=MEDCouplingFieldInt(ON_CELLS) ; f.setMesh(m) ; arr=DataArrayInt(6) ; arr.iota() ; f.setArray(arr) ; f.checkConsistencyLight() + f_0=f[::2] # test is here + self.assertTrue(f_0.getArray().isEqual(DataArrayInt([0,2,4]))) + self.assertTrue(f_0.getMesh().isEqual(m[[0,2,4]],1e-12)) + # + f2=MEDCouplingFieldInt(ON_NODES) ; f2.setMesh(m) ; arr=DataArrayInt(7) ; arr.iota() ; f2.setArray(arr) ; f2.checkConsistencyLight() + f_1=f2[::2] # test is here + self.assertTrue(f_1.getArray().isEqual(DataArrayInt([0,1,2,3,4,5]))) + m_1=m[[0,2,4]] ; m_1.zipCoords() + self.assertTrue(f_1.getMesh().isEqual(m_1,1e-12)) + pass pass -- 2.39.2