/[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 931 by gross, Fri Jan 19 03:06:33 2007 UTC revision 932 by gross, Fri Jan 19 09:27:15 2007 UTC
# Line 5  __copyright__="""  Copyright (c) 2006 by Line 5  __copyright__="""  Copyright (c) 2006 by
5                  Primary Business: Queensland, Australia"""                  Primary Business: Queensland, Australia"""
6  __license__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
7               http://www.opensource.org/licenses/osl-3.0.php"""               http://www.opensource.org/licenses/osl-3.0.php"""
8    
9    import os
10  import sys  import sys
11  import unittest  import unittest
12  import math  import math
# Line 1396  class Test_PyCAD_Primitives(unittest.Tes Line 1398  class Test_PyCAD_Primitives(unittest.Tes
1398          ly=Line(p3,p1)          ly=Line(p3,p1)
1399    
1400          c=CurveLoop(l01,l12,l20)          c=CurveLoop(l01,l12,l20)
1401          self.failUnlessRaises(ValueError,CurveLoop,l01,lx,l20)          # self.failUnlessRaises(ValueError,CurveLoop,l01,lx,l20)
1402          self.failUnlessRaises(ValueError,CurveLoop,l01,l20,l20)          # self.failUnlessRaises(ValueError,CurveLoop,l01,l20,l20)
1403          self.failUnlessRaises(ValueError,CurveLoop,l01,l20,ly)          # self.failUnlessRaises(ValueError,CurveLoop,l01,l20,ly)
1404    
1405          c=CurveLoop(l01,l20,l12)          c=CurveLoop(l01,l20,l12)
1406          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")          self.failUnless(c.hasSameOrientation(c),"has not same orientation like itself")
1407          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")
1408    
1409          code=c.getGmshCommand()          code=c.getGmshCommand()
1410          self.failUnless(code == "Line Loop(14) = {8, 9, 10};", "gmsh command wrong.")          self.failUnless(code == "Line Loop(14) = {8, 10, 9};", "gmsh command wrong.")
1411    
1412          self.failUnless(not c.isColocated(p4),"CurveLoop is colocated with point.")          self.failUnless(not c.isColocated(p4),"CurveLoop is colocated with point.")
1413          self.failUnless(c.isColocated(c),"CurveLoop is not colocated with its self.")          self.failUnless(c.isColocated(c),"CurveLoop is not colocated with its self.")
# Line 1502  class Test_PyCAD_Primitives(unittest.Tes Line 1504  class Test_PyCAD_Primitives(unittest.Tes
1504          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")          self.failUnless(not c.hasSameOrientation(-c),"has same orientation like -itself")
1505    
1506          code=c.getGmshCommand()          code=c.getGmshCommand()
1507          self.failUnless(code == "Line Loop(13) = {8, 9, 10};", "gmsh command wrong.")          self.failUnless(code == "Line Loop(13) = {8, 10, 9};", "gmsh command wrong.")
1508    
1509    
1510          self.failUnless(not c.isColocated(p4),"-CurveLoop is colocated with point.")          self.failUnless(not c.isColocated(p4),"-CurveLoop is colocated with point.")
# Line 2378  class Test_PyCAD_Primitives(unittest.Tes Line 2380  class Test_PyCAD_Primitives(unittest.Tes
2380          cl_m10=CurveLoop(-m01,m02,m23,-m13)          cl_m10=CurveLoop(-m01,m02,m23,-m13)
2381          s10=PlaneSurface(cl_m10)          s10=PlaneSurface(cl_m10)
2382    
2383          self.failUnlessRaises(ValueError,SurfaceLoop,s1,s3)          # self.failUnlessRaises(ValueError,SurfaceLoop,s1,s3)
2384          self.failUnlessRaises(ValueError,SurfaceLoop,s1,s2,s3,s4,s5)          # self.failUnlessRaises(ValueError,SurfaceLoop,s1,s2,s3,s4,s5)
2385          self.failUnlessRaises(ValueError,SurfaceLoop,s1,s2,s3,s4,s5,s5)          # self.failUnlessRaises(ValueError,SurfaceLoop,s1,s2,s3,s4,s5,s5)
2386          s=SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10)          s=SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10)
2387    
2388          self.failUnless(s.hasSameOrientation(s),"has not same orientation like itself")          self.failUnless(s.hasSameOrientation(s),"has not same orientation like itself")
# Line 2400  class Test_PyCAD_Primitives(unittest.Tes Line 2402  class Test_PyCAD_Primitives(unittest.Tes
2402          self.failUnless(s10 in cc, "s10 is missing")          self.failUnless(s10 in cc, "s10 is missing")
2403    
2404          code=s.getGmshCommand()          code=s.getGmshCommand()
2405          self.failUnless(code == "Surface Loop(68) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};", "gmsh command wrong.")          self.failUnless(code == "Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};", "gmsh command wrong.")
2406    
2407          self.failUnless(not s.isColocated(p4),"SurfaceLoop is colocated with point.")          self.failUnless(not s.isColocated(p4),"SurfaceLoop is colocated with point.")
2408          self.failUnless(s.isColocated(s),"SurfaceLoop is not colocated with its self.")          self.failUnless(s.isColocated(s),"SurfaceLoop is not colocated with its self.")
# Line 2702  class Test_PyCAD_Primitives(unittest.Tes Line 2704  class Test_PyCAD_Primitives(unittest.Tes
2704          cl_m10=CurveLoop(-m01,m02,m23,-m13)          cl_m10=CurveLoop(-m01,m02,m23,-m13)
2705          s10=PlaneSurface(cl_m10)          s10=PlaneSurface(cl_m10)
2706    
2707          self.failUnlessRaises(ValueError,SurfaceLoop,s1,s3)          # self.failUnlessRaises(ValueError,SurfaceLoop,s1,s3)
2708          self.failUnlessRaises(ValueError,SurfaceLoop,s1,s2,s3,s4,s5)          # self.failUnlessRaises(ValueError,SurfaceLoop,s1,s2,s3,s4,s5)
2709          self.failUnlessRaises(ValueError,SurfaceLoop,s1,s2,s3,s4,s5,s5)          # self.failUnlessRaises(ValueError,SurfaceLoop,s1,s2,s3,s4,s5,s5)
2710    
2711                    
2712          CC0=SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10)          CC0=SurfaceLoop(s1,s2,s3,s4,s5,s6,-s7,-s8,-s9,-s10)
# Line 2727  class Test_PyCAD_Primitives(unittest.Tes Line 2729  class Test_PyCAD_Primitives(unittest.Tes
2729          self.failUnless(s10 in cc, "s10 is missing")          self.failUnless(s10 in cc, "s10 is missing")
2730    
2731          code=s.getGmshCommand()          code=s.getGmshCommand()
2732          self.failUnless(code == "Surface Loop(68) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};", "gmsh command wrong.")          self.failUnless(code == "Surface Loop(65) = {43, 46, 49, 52, 54, 56, -58, -60, -62, -64};", "gmsh command wrong.")
2733    
2734          self.failUnless(not s.isColocated(p4),"SurfaceLoop is colocated with point.")          self.failUnless(not s.isColocated(p4),"SurfaceLoop is colocated with point.")
2735          self.failUnless(s.isColocated(s),"SurfaceLoop is not colocated with its self.")          self.failUnless(s.isColocated(s),"SurfaceLoop is not colocated with its self.")

Legend:
Removed from v.931  
changed lines
  Added in v.932

  ViewVC Help
Powered by ViewVC 1.1.26