From 05502ef6668ee78b668b33f67c1e725d25779f89 Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 22 Mar 2013 07:32:38 +0000 Subject: [PATCH] Additionnal little test to check the possibility to remove names in MEDFileMesh DS. --- src/MEDLoader/Swig/MEDLoaderTest3.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index 0a1746a54..2e5247f59 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -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]) -- 2.39.2