/[thuban]/branches/WIP-pyshapelib-bramz/test/test_layer.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/test/test_layer.py

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

revision 336 by bh, Fri Sep 20 16:26:09 2002 UTC revision 395 by jonathan, Mon Feb 10 15:28:02 2003 UTC
# Line 147  class TestLayerLegend(unittest.TestCase, Line 147  class TestLayerLegend(unittest.TestCase,
147          # no messages should have been produced          # no messages should have been produced
148          self.check_messages([])          self.check_messages([])
149    
     def test_fill(self):  
         """Test Layer's fill attribute"""  
         # modify the fill  
         self.layer.SetFill(Color(0.5, 1.0, 0.75))  
         self.check_messages([(self.layer, LAYER_LEGEND_CHANGED)])  
         self.assertEquals(self.layer.fill.hex().lower(), "#7fffbf")  
         self.assert_(self.layer.WasModified())  
   
     def test_stroke(self):  
         """Test Layer's stroke attribute"""  
         self.layer.SetStroke(Color(0.5, 1.0, 0.75))  
         self.assertEquals(self.layer.stroke.hex().lower(), "#7fffbf")  
         self.check_messages([(self.layer, LAYER_LEGEND_CHANGED)])  
         self.assert_(self.layer.WasModified())  
   
     def test_stroke_width(self):  
         """Test Layer's stroke_width attribute"""  
         self.layer.SetStrokeWidth(3.0)  
         self.assertEquals(self.layer.stroke_width, 3.0)  
         self.check_messages([(self.layer, LAYER_LEGEND_CHANGED)])  
         self.assert_(self.layer.WasModified())  
   
150      def test_visibility(self):      def test_visibility(self):
151          """Test Layer visibility"""          """Test Layer visibility"""
152          self.layer.SetVisible(0)          self.layer.SetVisible(0)
# Line 179  class TestLayerLegend(unittest.TestCase, Line 157  class TestLayerLegend(unittest.TestCase,
157          # the layer.          # the layer.
158          self.failIf(self.layer.WasModified())          self.failIf(self.layer.WasModified())
159    
160      def test_tree_info(self):      
161          """Test Layer.TreeInfo"""  #
162          self.assertEquals(self.layer.TreeInfo(),  # the tree info now contains Color objects which are difficult to test
163                            ("Layer 'Test Layer'",  #
164                             ['Shown',  #   def test_tree_info(self):
165                              'Shapes: 156',  #       """Test Layer.TreeInfo"""
166                              ('Extent (lat-lon):'  #       self.assertEquals(self.layer.TreeInfo(),
167                               ' (-24.5465, 63.2868, -13.4958, 66.5638)'),  #                         ("Layer 'Test Layer'",
168                              'Shapetype: Polygon',  #                          ['Shown',
169                              'Fill: None',  #                           'Shapes: 156',
170                              'Outline: (0.000, 0.000, 0.000)']))  #                           ('Extent (lat-lon):'
171    #                            ' (-24.5465, 63.2868, -13.4958, 66.5638)'),
172    #                           'Shapetype: Polygon',
173    #                           'Fill: None',
174    #                           'Outline: (0.000, 0.000, 0.000)']))
175    
176    
177  if __name__ == "__main__":  if __name__ == "__main__":

Legend:
Removed from v.336  
changed lines
  Added in v.395

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26