2 # -*- coding: iso-8859-1 -*-
3 # Copyright (C) 2007-2014 CEA/DEN, EDF R&D
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License, or (at your option) any later version.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # This file defines some properties for test purposes
27 MED_ROOT_DIR=os.environ["MED_ROOT_DIR"]
29 raise RuntimeError("MED_ROOT_DIR should be defined to load the test data")
31 RESDIR=os.path.join(MED_ROOT_DIR,"share","salome","resources","med","medop_testfiles")
34 testFileName = "testfield.med"
36 testFieldName= "testfield1"
39 testTypeOfField = 0 # On cells
40 return testFileName, testMeshName, testFieldName, testTypeOfField, testFieldIt, testFieldDt
43 testFileName = "smallmesh_varfield.med"
44 testMeshName = "My2DMesh"
45 testFieldName= "testfield2"
48 testTypeOfField = 1 # On nodes
49 return testFileName, testMeshName, testFieldName, testTypeOfField, testFieldIt, testFieldDt
52 testFileName = "fieldlena.med"
53 testMeshName = "lenamesh"
54 testFieldName= "lenafield"
57 testTypeOfField = 0 # On cells
58 return testFileName, testMeshName, testFieldName, testTypeOfField, testFieldIt, testFieldDt
62 testFileName, testMeshName, testFieldName, testTypeOfField, testFieldIt, testFieldDt = testdata()
63 testFilePath = os.path.join(RESDIR,testFileName)
66 def setup(testdata=testdata_02):
67 global testFileName, testMeshName, testFieldName
68 global testFieldIt, testFieldDt, testFilePath, testTypeOfField
69 testFileName, testMeshName, testFieldName, testTypeOfField, testFieldIt, testFieldDt = testdata()
70 testFilePath = os.path.join(RESDIR,testFileName)
74 Displays the properties values defined in this script.
76 print 60*"=" + " Properties values - START"
77 print "MED_ROOT_DIR = ",MED_ROOT_DIR
78 print "RESDIR = ",RESDIR
79 print "testFileName = ",testFileName
80 print "testFilePath = ",testFilePath
81 print 60*"=" + " Properties values - END"
85 def getFilePath(filename):
87 Returns the absolute path for a given file base name. The base
88 name must match with a file contained in the test files directory.
90 filepath = os.path.join(RESDIR,filename)
91 if not os.path.exists(filepath):
92 raise RuntimeError("The file %s does not exists"%filepath)