/[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 922 by gross, Wed Jan 3 22:54:50 2007 UTC revision 923 by gross, Tue Jan 9 22:50:43 2007 UTC
# Line 1069  class Test_PyCAD_Primitives(unittest.Tes Line 1069  class Test_PyCAD_Primitives(unittest.Tes
1069          self.failUnless(not dc.getStartPoint() == p_start,"start point of dilation is identical to source.")          self.failUnless(not dc.getStartPoint() == p_start,"start point of dilation is identical to source.")
1070          self.failUnless(not dc.getEndPoint() == p_end,"end point of dilation is identical to source.")          self.failUnless(not dc.getEndPoint() == p_end,"end point of dilation is identical to source.")
1071    
1072       def test_CurveLoop(self):
1073            p0=Point(0,0,0,0.1)
1074            p1=Point(1,1,1,0.2)
1075            p2=Point(2,2,2,0.3)
1076            p3=Point(3,3,3,0.4)
1077            p4=Point(1,2,3)
1078            p5=Point(1,2,3)
1079            p6=Point(1,2,3)
1080    
1081            l01=Line(p0,p1)
1082            l12=Arc(p3,p1,p2)
1083            l20=Spline(p2,p4,p0)
1084    
1085            lx=Line(p2,p3)
1086            ly=Line(p3,p1)
1087    
1088            c=CurveLoop(l01,l12,l20)
1089            c=CurveLoop(l01,l20,l12)
1090            self.failUnlessRaises(TypeError,ValueError,CurveLoop,l01,lx,l20,msg="loop detected.")
1091            self.failUnlessRaises(TypeError,ValueError,CurveLoop,l01,l20,l20,msg="douple not detected.")
1092            self.failUnlessRaises(TypeError,ValueError,CurveLoop,l01,l20,ly,msg="loop detected.")
1093    
1094            code=c.getGmshCommand()
1095            self.failUnless(code == "Line Loop(14) = {8, 9, 10};", "gmsh command wrong.")
1096    
1097            cc=c.getCurves()
1098            self.failUnless(len(cc) == 3, "too many curves.")
1099            self.failUnless(l01 in cc, "l01 is missing")
1100            self.failUnless(l12 in cc, "l12 is missing")
1101            self.failUnless(l20 in cc, "l20 is missing")
1102            
1103  if __name__ == '__main__':  if __name__ == '__main__':
1104     suite = unittest.TestSuite()     suite = unittest.TestSuite()
1105     suite.addTest(unittest.makeSuite(Test_PyCAD_Transformations))     suite.addTest(unittest.makeSuite(Test_PyCAD_Transformations))

Legend:
Removed from v.922  
changed lines
  Added in v.923

  ViewVC Help
Powered by ViewVC 1.1.26