From: abn Date: Wed, 23 Sep 2015 12:09:42 +0000 (+0200) Subject: Moving empty mesh test to MEDLoaderTest3.py X-Git-Tag: V7_7_0_WIN~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f2529d0e619b4b86d50be9eb2eb4dced34fe86d8;p=modules%2Fmed.git Moving empty mesh test to MEDLoaderTest3.py --- diff --git a/src/MEDLoader/Swig/MEDLoaderTest3.py b/src/MEDLoader/Swig/MEDLoaderTest3.py index f06132a37..e37a7af6f 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest3.py +++ b/src/MEDLoader/Swig/MEDLoaderTest3.py @@ -4611,6 +4611,21 @@ class MEDLoaderTest(unittest.TestCase): self.assertTrue(mm.getUnivName()!="") pass + def testEmptyMesh(self): + """ MEDLoader should be able to consistently write and read an empty mesh (coords array + with 0 tuples """ + fname = "Pyfile96.med" + m = MEDCouplingUMesh('toto', 2) + m.setCoords(DataArrayDouble([], 0, 2)) + m.setConnectivity(DataArrayInt([]), DataArrayInt([0])) + mfu = MEDFileUMesh() + mfu.setMeshAtLevel(0, m) + mfu.write(fname, 2) + mfu2 = MEDFileUMesh(fname) + self.assertEqual('toto', mfu2.getName()) + lvl = mfu2.getNonEmptyLevels() + self.assertEqual((), lvl) + pass if __name__ == "__main__": diff --git a/src/MEDLoader/Swig/MEDLoaderTest4.py b/src/MEDLoader/Swig/MEDLoaderTest4.py index 7fbc0edc0..706b63b09 100644 --- a/src/MEDLoader/Swig/MEDLoaderTest4.py +++ b/src/MEDLoader/Swig/MEDLoaderTest4.py @@ -5114,19 +5114,6 @@ class MEDLoaderTest4(unittest.TestCase): pass pass - def testEmptyMesh(self): - fname = "empty_mesh.med" - m = MEDCouplingUMesh('toto', 2) - m.setCoords(DataArrayDouble([], 0, 2)) - m.setConnectivity(DataArrayInt([]), DataArrayInt([0])) - mfu = MEDFileUMesh() - mfu.setMeshAtLevel(0, m) - mfu.write(fname, 2) - mfu2 = MEDFileUMesh(fname) - self.assertEqual('toto', mfu2.getName()) - lvl = mfu2.getNonEmptyLevels() - self.assertEqual((), lvl) - pass if __name__ == "__main__":