]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Additionnal little test to check the possibility to remove names in MEDFileMesh DS.
authorageay <ageay>
Fri, 22 Mar 2013 07:32:38 +0000 (07:32 +0000)
committerageay <ageay>
Fri, 22 Mar 2013 07:32:38 +0000 (07:32 +0000)
src/MEDLoader/Swig/MEDLoaderTest3.py

index 0a1746a54d758416d391e16e98f234141a8b4d0c..2e5247f59a8b237986a82307054df472d18f1f47 100644 (file)
@@ -2098,6 +2098,17 @@ class MEDLoaderTest(unittest.TestCase):
         self.assertTrue(mm.isEqual(mmr,1e-12)[0])
         mmCpy=mm.deepCpy()
         self.assertTrue(mm.isEqual(mmCpy,1e-12)[0])
+        # remove names on nodes
+        mmCpy.setNameFieldAtLevel(1,None)
+        self.assertTrue(not mm.isEqual(mmCpy,1e-12)[0])
+        mm.setNameFieldAtLevel(1,None)
+        self.assertTrue(mm.isEqual(mmCpy,1e-12)[0])
+        mm.setNameFieldAtLevel(-1,None)
+        mm.write(fname,2)
+        mmr=MEDFileMesh.New(fname)
+        self.assertEqual(mmr.getNameFieldAtLevel(1),None)
+        self.assertTrue(mmr.getNameFieldAtLevel(0).isEqual(DataArrayAsciiChar(["CellL0#%.3d      "%(i) for i in xrange(6)])))
+        self.assertEqual(mmr.getNameFieldAtLevel(-1),None)
         #
         c=MEDCouplingCMesh()
         arr=DataArrayDouble([0.,1.1,2.3])