]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
MEDWriter tests write in tmp directory cbr/improve_medwriter_with_int64_fields
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Wed, 6 Jan 2021 09:24:27 +0000 (10:24 +0100)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Wed, 6 Jan 2021 09:24:27 +0000 (10:24 +0100)
src/Plugins/MEDWriter/plugin/Test/TestMEDWriter0.py
src/Plugins/MEDWriter/plugin/Test/TestMEDWriter1.py

index 347c1e51ad97247f12ffa0b5f0bd916ae627bfde..332097b87be6f1899df5281b414c68433b992a59 100644 (file)
@@ -23,11 +23,14 @@ from paraview.simple import *
 import MEDLoader as ml
 import os
 from math import pi,sqrt
+import tempfile
 
 #### disable automatic camera reset on 'Show'
 paraview.simple._DisableFirstRenderCameraReset()
 
-pat='testMEDWriter_%i.med'
+tmpdir = tempfile.TemporaryDirectory(prefix="MEDWriter_")
+
+pat=os.path.join(tmpdir.name, 'testMEDWriter_%i.med')
 fname0=pat%0
 fname1=pat%1
 fname2=pat%2
index ab2e474c39f35f450017e92265c701a05c3c2ca2..31c61180e528b43c454b3d531727d4bcd4e87756 100644 (file)
@@ -22,13 +22,15 @@ from paraview.simple import *
 import MEDLoader as ml
 import os
 from math import pi,sqrt
+import tempfile
 
 #### disable automatic camera reset on 'Show'
 paraview.simple._DisableFirstRenderCameraReset()
 
-#fname_int32='testMEDWriter_int32.med'
-fname_int64 = 'testMEDWriter_int64.med'
-fname_int64_exported = 'testMEDWriter_int64_exported.med'
+tmpdir = tempfile.TemporaryDirectory(prefix="MEDWriter_")
+
+fname_int64 = os.path.join(tmpdir.name, 'testMEDWriter_int64.med')
+fname_int64_exported = os.path.join(tmpdir.name, 'testMEDWriter_int64_exported.med')
 
 ### test with int array field
 
@@ -84,8 +86,6 @@ f1ts12n.setFieldNoProfileSBT(f1n)
 f1ts12n.write(fname_int64,0)
 
 test12=MEDReader(FileName=fname_int64)
-#test12.AllArrays=['TS0/%s/ComSup0/%s@@][@@P0'%(mName,fieldNameOnCells),'TS0/%s/ComSup0/%s@@][@@P1'%(mName,fieldNameOnNodes)]
-#test12.AllTimeSteps = ['0000']
 SaveData(fname_int64_exported, WriteAllTimeSteps=1)
 ### test content of fname_int64_exported
 mfd2=ml.MEDFileData(fname_int64_exported)