From f2529d0e619b4b86d50be9eb2eb4dced34fe86d8 Mon Sep 17 00:00:00 2001 From: abn Date: Wed, 23 Sep 2015 14:09:42 +0200 Subject: [PATCH] Moving empty mesh test to MEDLoaderTest3.py --- src/MEDLoader/Swig/MEDLoaderTest3.py | 15 +++++++++++++++ src/MEDLoader/Swig/MEDLoaderTest4.py | 13 ------------- 2 files changed, 15 insertions(+), 13 deletions(-) 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__": -- 2.39.2