from MEDLoader import *
import unittest
import os
+from MEDLoaderDataForTest import WriteInTmpDir
class MEDLoaderBasicsTest(unittest.TestCase):
+ @WriteInTmpDir
def testExampleReadFieldOnAllEntity1(self):
from MEDLoaderDataForTest import MEDLoaderDataForTest
#! [PySnippetReadFieldOnAllEntity1_1]
#! [PySnippetReadFieldOnAllEntity1_5]
pass
+ @WriteInTmpDir
def testExampleReadFieldPartial1(self):
from MEDLoaderDataForTest import MEDLoaderDataForTest
#! [PySnippetReadFieldPartial1_1]
#! [PySnippetReadFieldPartial1_6]
pass
+ @WriteInTmpDir
def testExampleMeshAdvAPI1(self):
da=DataArrayDouble.New([0.,1.1,2.3,3.6])
meshName="Example2"
from MEDLoader import *
import unittest, os
-from MEDLoaderDataForTest import MEDLoaderDataForTest
+from MEDLoaderDataForTest import MEDLoaderDataForTest,WriteInTmpDir
class SauvLoaderTest(unittest.TestCase):
raise Exception("SauvLoaderTest: Unable to get resource directory")
return pth
pass
-
+
+ @WriteInTmpDir
def testSauv2Med(self):
# get a file containing all types of readable piles
sauvFile = os.path.join( self.__getResourcesDirectory(),"allPillesTest.sauv")
os.remove( medFile )
pass
+ @WriteInTmpDir
def testMed2Sauv(self):
# read pointe.med
medFile = os.path.join(self.__getResourcesDirectory(),"pointe.med")
os.remove( sauvFile )
pass
+ @WriteInTmpDir
def testSauv2MedWONodeFamilyNum(self):
"""test for issue 0021673: [CEA 566] Bug in SauvWriter when writing meshes
having no family ids on nodes."""
os.remove( medFile )
pass
+ @WriteInTmpDir
def testSauv2MedOnPipe1D(self):
"""test for issue 0021745: [CEA 600] Some missing groups in mesh after reading a SAUV file with SauvReader."""
sauvFile="Test_sauve_1D.sauv"
os.remove(sauvFile)
pass
+ @WriteInTmpDir
def testSauvReaderOnBigMesh(self):
# create a box with 1 million cells
mesh_dim = 3
pass
@unittest.skipUnless(HasXDR(),"requires XDR")
+ @WriteInTmpDir
def testMissingGroups(self):
"""test for issue 0021749: [CEA 601] Some missing groups in mesh after reading a SAUV file with SauvReader."""
sauvFile = os.path.join(self.__getResourcesDirectory(),"BDC-714.sauv")
pass
@unittest.skipUnless(HasXDR(),"requires XDR")
+ @WriteInTmpDir
def testReadSauvXDRCastem17(self):
"""test reading Castem17 XDR sauv with 'ENREGISTREMENT DE TYPE 8'"""
sauvFile = os.path.join(self.__getResourcesDirectory(),"castem17_result_xdr.sauv")
self.assertTrue( fieldArray.isEqualWithoutConsideringStr( expectedArray, 1e-12 ))
pass
+ @WriteInTmpDir
def testReadSauvAsciiCastem17(self):
"""test reading Castem17 ascii sauv with 'ENREGISTREMENT DE TYPE 8'"""
sauvFile = os.path.join(self.__getResourcesDirectory(),"castem17_result_ascii.sauv")
self.assertTrue( fieldArray.isEqualWithoutConsideringStr( expectedArray, 1e-12 ))
pass
+ @WriteInTmpDir
def testGaussPt(self):
"""issue 22321: [CEA 933] Bug when reading a sauve file containing field on Gauss Pt.
The problem was that a field ON_GAUSS_PT was created but no Gauss Localization
os.remove( sauvFile )
pass
+ @WriteInTmpDir
def testSauvWriterGroupWithOneFamily(self):
"""
This test checks an option for sauv writing. It is requested here to copy a group from a family if a group is lying on a single family.