/[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 934 by gross, Tue Jan 23 09:52:45 2007 UTC revision 1044 by gross, Mon Mar 19 07:29:31 2007 UTC
# Line 15  import sys Line 15  import sys
15  import os  import os
16  import unittest  import unittest
17  from esys.escript import *  from esys.escript import *
18  from esys.finley import Interval,Rectangle,Brick,JoinFaces, ReadGmsh  from esys.finley import Interval,Rectangle,Brick,JoinFaces, ReadGmsh, ReadMesh
19    
20  try:  try:
21       FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']       FINLEY_TEST_DATA=os.environ['FINLEY_TEST_DATA']
# Line 211  class Test_GMSHReader(unittest.TestCase) Line 211  class Test_GMSHReader(unittest.TestCase)
211         dom.write(test)         dom.write(test)
212         self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)         self.compare(test, FINLEY_TEST_MESH_PATH+os.sep+ref)
213    
214    class Test_Reader(unittest.TestCase):
215       def test_ReadWriteTagNames(self):
216           file="hex_2D_order2.msh"
217           test = FINLEY_WORKDIR+os.sep+"test.fly"
218           dom = ReadMesh(FINLEY_TEST_MESH_PATH+os.sep+file,3)
219           insertTagNames(dom,A=1,B=2)
220           dom.write(test)
221           dom2 = ReadMesh(test,3)
222           t=getTagNames(dom)
223           self.failUnless(len(t)==2)
224           self.failUnless("A" in t)
225           self.failUnless("B" in t)
226           self.failUnless(dom2.getTag("A") == 1)
227           self.failUnless(dom2.getTag("B") == 2)
228           self.failUnless(dom2.isValidTagName("A"))
229           self.failUnless(dom2.isValidTagName("B"))
230          
231    
232  if __name__ == '__main__':  if __name__ == '__main__':
233     suite = unittest.TestSuite()     suite = unittest.TestSuite()
234     suite.addTest(unittest.makeSuite(Test_Generators))     suite.addTest(unittest.makeSuite(Test_Generators))
235     suite.addTest(unittest.makeSuite(Test_GMSHReader))     suite.addTest(unittest.makeSuite(Test_GMSHReader))
236       suite.addTest(unittest.makeSuite(Test_Reader))
237     s=unittest.TextTestRunner(verbosity=2).run(suite)     s=unittest.TextTestRunner(verbosity=2).run(suite)
238     if s.wasSuccessful():     if s.wasSuccessful():
239       sys.exit(0)       sys.exit(0)

Legend:
Removed from v.934  
changed lines
  Added in v.1044

  ViewVC Help
Powered by ViewVC 1.1.26