Ignore:
Timestamp:
Aug 22, 2008, 11:56:30 AM (16 years ago)
Author:
duncan
Message:

update to add_points_and_segments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/pmesh/test_mesh.py

    r5207 r5673  
    15001500        points =  [[0.0, 0.0], [1.0, 0.0], [1.0, 1.0]]
    15011501        segments = [[0, 1], [1, 2]]
    1502         segment_tags = {'do-op':[1]}
     1502        segment_tags = {'hair':[1]}
    15031503        m.add_points_and_segments(points,
    15041504                                    segments, segment_tags)
     
    15131513        self.failUnless(m.userSegments[0].tag =='food',
    15141514                        'Wrong segment tag length.')
    1515         self.failUnless(m.userSegments[1].tag =='do-op',
     1515        self.failUnless(m.userSegments[1].tag =='hair',
     1516                        'Wrong segment tag.')
     1517       
     1518    def test_add_points_and_segmentsII(self):
     1519        m = Mesh()
     1520        Segment.set_default_tag("food")
     1521        dict = {}
     1522        points =  [[0.0, 0.0], [1.0, 0.0], [1.0, 1.0]]
     1523        segments = None #[[0, 1], [1, 2]]
     1524        segment_tags = {'hair':[1]}
     1525        m.add_points_and_segments(points,
     1526                                    segments, segment_tags)
     1527        # have to reset this , since it's a class attribute
     1528        Segment.set_default_tag("")
     1529
     1530       
     1531        self.failUnless(len(m.userSegments) ==2,
     1532                        'Wrong segment list length.')
     1533        self.failUnless(len(m.userVertices) == 3,
     1534                        'Wrong vertex list length.')
     1535        self.failUnless(m.userSegments[0].tag =='food',
     1536                        'Wrong segment tag length.')
     1537        self.failUnless(m.userSegments[1].tag =='hair',
    15161538                        'Wrong segment tag.')
    15171539       
     
    18421864         
    18431865        self.failUnless(segs[2].tag=='bom',
    1844                         'FAILED!') 
     1866                        'FAILED!')
    18451867        self.failUnless(segs[3].tag=='',
    18461868                        'FAILED!')
     
    22872309    #suite = unittest.makeSuite(meshTestCase,'test_asciiFile')
    22882310    #suite = unittest.makeSuite(meshTestCase,'test_mesh2IO')
    2289     #suite = unittest.makeSuite(meshTestCase,'test_import_ungenerate_file')
     2311    #suite = unittest.makeSuite(meshTestCase,'test_add_points_and_segmentsII')
    22902312    runner = unittest.TextTestRunner() #verbosity=2)
    22912313    runner.run(suite)
Note: See TracChangeset for help on using the changeset viewer.