/[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 1122 by btully, Thu Apr 19 04:21:43 2007 UTC revision 1123 by gross, Thu May 3 04:13:52 2007 UTC
# Line 3042  class Test_PyCAD_Primitives(unittest.Tes Line 3042  class Test_PyCAD_Primitives(unittest.Tes
3042         p4=Point(8.,6,-6,local_scale=9.)         p4=Point(8.,6,-6,local_scale=9.)
3043                
3044         # create property set with dim:         # create property set with dim:
        self.failUnlessRaises(ValueError,PropertySet,"test0")  
3045         self.failUnlessRaises(TypeError,PropertySet,"test0",p0, Line(p0,p1))         self.failUnlessRaises(TypeError,PropertySet,"test0",p0, Line(p0,p1))
3046    
3047         ps=PropertySet("test0",p0, p1)         ps=PropertySet("test0",p0, p1)
# Line 3052  class Test_PyCAD_Primitives(unittest.Tes Line 3051  class Test_PyCAD_Primitives(unittest.Tes
3051         ps.setName("test1")         ps.setName("test1")
3052         self.failUnless(ps.getName() == "test1", "wrong new name")         self.failUnless(ps.getName() == "test1", "wrong new name")
3053    
3054         self.failUnless(ps.getTag() == 8, "wrong tag")         self.failUnless(ps.getTag() == 7, "wrong tag")
3055                
3056         self.failUnlessRaises(TypeError,ps.addItem, Line(p0,p1))         self.failUnlessRaises(TypeError,ps.addItem, Line(p0,p1))
3057         ps.addItem(p3,p4)         ps.addItem(p3,p4)
# Line 3085  class Test_PyCAD_Primitives(unittest.Tes Line 3084  class Test_PyCAD_Primitives(unittest.Tes
3084         l1=Arc(p3,p1,p4)         l1=Arc(p3,p1,p4)
3085         l2=Line(p4,p0)         l2=Line(p4,p0)
3086         # create property set with dim:         # create property set with dim:
        self.failUnlessRaises(ValueError,PropertySet,"test0")  
3087         self.failUnlessRaises(TypeError,PropertySet,"test0",l0, p0)         self.failUnlessRaises(TypeError,PropertySet,"test0",l0, p0)
3088    
3089         ps=PropertySet("test0", l0, l1)         ps=PropertySet("test0", l0, l1)
# Line 3095  class Test_PyCAD_Primitives(unittest.Tes Line 3093  class Test_PyCAD_Primitives(unittest.Tes
3093         ps.setName("test1")         ps.setName("test1")
3094         self.failUnless(ps.getName() == "test1", "wrong new name")         self.failUnless(ps.getName() == "test1", "wrong new name")
3095    
3096         self.failUnless(ps.getTag() == 10, "wrong tag")         self.failUnless(ps.getTag() == 9, "wrong tag")
3097                
3098         self.failUnlessRaises(TypeError,ps.addItem, p0)         self.failUnlessRaises(TypeError,ps.addItem, p0)
3099         ps.addItem(l2)         ps.addItem(l2)
# Line 3143  class Test_PyCAD_Primitives(unittest.Tes Line 3141  class Test_PyCAD_Primitives(unittest.Tes
3141         s=PlaneSurface(cl,holes=[h])         s=PlaneSurface(cl,holes=[h])
3142    
3143         # create property set with dim:         # create property set with dim:
        self.failUnlessRaises(ValueError,PropertySet,"test0")  
3144         self.failUnlessRaises(TypeError,PropertySet,"test0",s, p0)         self.failUnlessRaises(TypeError,PropertySet,"test0",s, p0)
3145    
3146         ps=PropertySet("test0", s)         ps=PropertySet("test0", s)
# Line 3153  class Test_PyCAD_Primitives(unittest.Tes Line 3150  class Test_PyCAD_Primitives(unittest.Tes
3150         ps.setName("test1")         ps.setName("test1")
3151         self.failUnless(ps.getName() == "test1", "wrong new name")         self.failUnless(ps.getName() == "test1", "wrong new name")
3152    
3153         self.failUnless(ps.getTag() == 20, "wrong tag")         self.failUnless(ps.getTag() == 19, "wrong tag")
3154                
3155         pp=ps.getPrimitives()         pp=ps.getPrimitives()
3156         self.failUnless(len(pp) == 18, "wrong number of items")         self.failUnless(len(pp) == 18, "wrong number of items")
# Line 3258  class Test_PyCAD_Primitives(unittest.Tes Line 3255  class Test_PyCAD_Primitives(unittest.Tes
3255         v=Volume(s_out,holes=[s_inner])         v=Volume(s_out,holes=[s_inner])
3256                        
3257         # create property set with dim:         # create property set with dim:
        self.failUnlessRaises(ValueError,PropertySet,"test0")  
3258         self.failUnlessRaises(TypeError,PropertySet,"test0",v, p0)         self.failUnlessRaises(TypeError,PropertySet,"test0",v, p0)
3259    
3260         ps=PropertySet("test0", v)         ps=PropertySet("test0", v)
# Line 3268  class Test_PyCAD_Primitives(unittest.Tes Line 3264  class Test_PyCAD_Primitives(unittest.Tes
3264         ps.setName("test1")         ps.setName("test1")
3265         self.failUnless(ps.getName() == "test1", "wrong new name")         self.failUnless(ps.getName() == "test1", "wrong new name")
3266    
3267         self.failUnless(ps.getTag() == 70, "wrong tag")         self.failUnless(ps.getTag() == 69, "wrong tag")
3268                
3269         pp=ps.getPrimitives()         pp=ps.getPrimitives()
3270         self.failUnless(len(pp) == 68, "too many primitives.")         self.failUnless(len(pp) == 68, "too many primitives.")

Legend:
Removed from v.1122  
changed lines
  Added in v.1123

  ViewVC Help
Powered by ViewVC 1.1.26