/[escript]/trunk/finley/test/python/run_generators.py
ViewVC logotype

Diff of /trunk/finley/test/python/run_generators.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 708 by gross, Wed Apr 12 23:58:02 2006 UTC revision 709 by gross, Wed Apr 26 06:35:36 2006 UTC
# Line 17  import unittest Line 17  import unittest
17  from esys.escript import *  from esys.escript import *
18  from esys.finley import Interval,Rectangle,Brick,JoinFaces  from esys.finley import Interval,Rectangle,Brick,JoinFaces
19    
20    FINLEY_TEST_DATA_PATH=os.environ['FINLEY_TEST_DATA']+"/data_meshes/"
21    FINLEY_WORKDIR_PATH=os.environ['FINLEY_WORKDIR']+"/"
22    
23  TEST_FILE_EXT=".test"  TEST_FILE_EXT=".test"
24  class Test_Generators(unittest.TestCase):  class Test_Generators(unittest.TestCase):
25    
26     def checker(self,dom,reference):     def checker(self,dom,reference):
27        dom_file=os.environ['FINLEY_TEST_DATA']+"/"+reference+TEST_FILE_EXT        dom_file=FINLEY_WORKDIR_PATH+TEST_FILE_EXT
28        dom.write(dom_file)        dom.write(dom_file)
29        dom_string=open(dom_file).read().splitlines()        dom_string=open(dom_file).read().splitlines()
30        ref_string=open(os.environ['FINLEY_WORKDIR']+"/"+reference).read().splitlines()        ref_string=open(FINLEY_TEST_DATA_PATH+reference).read().splitlines()
31        self.failUnlessEqual(len(dom_string),len(ref_string),"number of lines in mesh files does not match reference")        self.failUnlessEqual(len(dom_string),len(ref_string),"number of lines in mesh files does not match reference")
32        for l in range(1,len(ref_string)):        for l in range(1,len(ref_string)):
33           self.failUnlessEqual(dom_string[l].strip(),ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),dom_string[l].strip()))           self.failUnlessEqual(dom_string[l].strip(),ref_string[l].strip(),"line %d (%s) in mesh files does not match reference (%s)"%(l,ref_string[l].strip(),dom_string[l].strip()))

Legend:
Removed from v.708  
changed lines
  Added in v.709

  ViewVC Help
Powered by ViewVC 1.1.26