/[escript]/trunk/pycad/test/python/run_pycad_test.py
ViewVC logotype

Diff of /trunk/pycad/test/python/run_pycad_test.py

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

revision 2418 by jfenwick, Mon Mar 30 02:13:58 2009 UTC revision 2419 by jfenwick, Thu May 14 01:56:18 2009 UTC
# Line 39  try: Line 39  try:
39  except KeyError:  except KeyError:
40       PYCAD_WORKDIR='.'       PYCAD_WORKDIR='.'
41    
42  PYCAD_TEST_MESH_PATH=PYCAD_TEST_DATA+os.sep+"data_meshes"+os.sep  #PYCAD_TEST_MESH_PATH=PYCAD_TEST_DATA+os.sep+"data_meshes"+os.sep
43  PYCAD_WORKDIR_PATH=PYCAD_WORKDIR+os.sep  #PYCAD_WORKDIR_PATH=PYCAD_WORKDIR+os.sep
44    
45    
46    
47  def _cross(x, y):  def _cross(x, y):
48      return numarray.array([x[1] * y[2] - x[2] * y[1], x[2] * y[0] - x[0] * y[2], x[0] * y[1] - x[1] * y[0]])      return numarray.array([x[1] * y[2] - x[2] * y[1], x[2] * y[0] - x[0] * y[2], x[0] * y[1] - x[1] * y[0]])
# Line 3658  class Test_PyCAD_Design(unittest.TestCas Line 3660  class Test_PyCAD_Design(unittest.TestCas
3660         script_name=d.getScriptFileName()         script_name=d.getScriptFileName()
3661         self.failUnless(isinstance(script_name,str))         self.failUnless(isinstance(script_name,str))
3662         self.failUnless(script_name.split(".")[-1] == "geo")         self.failUnless(script_name.split(".")[-1] == "geo")
3663         script_name=PYCAD_WORKDIR+os.sep+"script.geo"         script_name=os.path.join(PYCAD_WORKDIR,"script.geo")
3664         d.setScriptFileName(script_name)         d.setScriptFileName(script_name)
3665         self.failUnless(script_name == d.getScriptFileName())         self.failUnless(script_name == d.getScriptFileName())
3666    
3667         mesh_name=d.getMeshFileName()         mesh_name=d.getMeshFileName()
3668         self.failUnless(isinstance(mesh_name,str))         self.failUnless(isinstance(mesh_name,str))
3669         self.failUnless(mesh_name.split(".")[-1] == "msh")         self.failUnless(mesh_name.split(".")[-1] == "msh")
3670         mesh_name=PYCAD_WORKDIR+os.sep+"mesh.msh"         mesh_name=os.path.join(PYCAD_WORKDIR,"mesh.msh")
3671         d.setMeshFileName(mesh_name)         d.setMeshFileName(mesh_name)
3672         self.failUnless(mesh_name == d.getMeshFileName())         self.failUnless(mesh_name == d.getMeshFileName())
3673                
3674         d.setOptions(algorithm=d.TETGEN,optimize_quality=False,smoothing=4)         d.setOptions(algorithm=d.TETGEN,optimize_quality=False,smoothing=4)
3675         cmd=d.getCommandString()         cmd=d.getCommandString()
3676         self.failUnless("gmsh -format msh -2 -algo tetgen -smooth 4 -v 0 -order 1 -o .%smesh.msh .%sscript.geo"%(os.sep,os.sep) == cmd)         self.failUnless("gmsh -format msh -2 -algo tetgen -smooth 4 -v 0 -order 1 -o %s %s"%(os.path.join(".","mesh.msh"), os.path.join(".","script.geo")) == cmd)
3677    
3678         d.setOptions(optimize_quality=True)         d.setOptions(optimize_quality=True)
3679         cmd=d.getCommandString()         cmd=d.getCommandString()
3680         self.failUnless("gmsh -format msh -2 -algo iso -smooth 1 -optimize -v 0 -order 1 -o .%smesh.msh .%sscript.geo"%(os.sep,os.sep) == cmd)         self.failUnless("gmsh -format msh -2 -algo iso -smooth 1 -optimize -v 0 -order 1 -o %s %s"%(os.path.join(".","mesh.msh"), os.path.join(".","script.geo")) == cmd)
3681    
3682         p0=Point(0.,0.,0.)         p0=Point(0.,0.,0.)
3683         p1=Point(1.,0.,0.)         p1=Point(1.,0.,0.)
# Line 3719  Physical Line(13) = {6, 7}; Line 3721  Physical Line(13) = {6, 7};
3721         script_name=d.getScriptFileName()         script_name=d.getScriptFileName()
3722         self.failUnless(isinstance(script_name,str))         self.failUnless(isinstance(script_name,str))
3723         self.failUnless(script_name.split(".")[-1] == "poly")         self.failUnless(script_name.split(".")[-1] == "poly")
3724         script_name=PYCAD_WORKDIR+os.sep+"script.poly"         script_name=os.path.join(PYCAD_WORKDIR,"script.poly")
3725         d.setScriptFileName(script_name)         d.setScriptFileName(script_name)
3726         self.failUnless(script_name == d.getScriptFileName())         self.failUnless(script_name == d.getScriptFileName())
3727    
3728         mesh_name=d.getMeshFileName()         mesh_name=d.getMeshFileName()
3729         self.failUnless(isinstance(mesh_name,str))         self.failUnless(isinstance(mesh_name,str))
3730         mesh_name=PYCAD_WORKDIR+os.sep+"mesh"         mesh_name=os.path.join(PYCAD_WORKDIR,"mesh")
3731         d.setMeshFileName(mesh_name)         d.setMeshFileName(mesh_name)
3732         self.failUnless(mesh_name == d.getMeshFileName())         self.failUnless(mesh_name == d.getMeshFileName())
3733                
3734         d.setOptions(cmdLineArgs="-Qpqa7.5")         d.setOptions(cmdLineArgs="-Qpqa7.5")
3735         cmd=d.getCommandString()         cmd=d.getCommandString()
3736         self.failUnless("triangle -Qpqa7.5 .%sscript.poly"%(os.sep) == cmd)         self.failUnless("triangle -Qpqa7.5 .%s"%(os.path.join(".","script.poly")) == cmd)
3737    
3738         p0=Point(0.,0.,0.)         p0=Point(0.,0.,0.)
3739         p1=Point(1.,0.,0.)         p1=Point(1.,0.,0.)

Legend:
Removed from v.2418  
changed lines
  Added in v.2419

  ViewVC Help
Powered by ViewVC 1.1.26