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

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

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

revision 332 by bh, Fri Sep 20 15:45:59 2002 UTC revision 395 by jonathan, Mon Feb 10 15:28:02 2003 UTC
# Line 186  class TestMapWithContents(TestMapBase, s Line 186  class TestMapWithContents(TestMapBase, s
186          self.map.SetProjection(proj)          self.map.SetProjection(proj)
187          self.assertFloatSeqEqual(self.map.ProjectedBoundingBox(),          self.assertFloatSeqEqual(self.map.ProjectedBoundingBox(),
188                                   (608873.03380603762, 7019694.6517963577,                                   (608873.03380603762, 7019694.6517963577,
189                                    1173560.0288053728, 7447353.2203218574))                                    1173560.0288053728, 7447353.2203218574),
190                                     epsilon = 1e-5)
191    
192      def test_set_projection(self):      def test_set_projection(self):
193          """Test Map.SetProjection"""          """Test Map.SetProjection"""
# Line 199  class TestMapWithContents(TestMapBase, s Line 200  class TestMapWithContents(TestMapBase, s
200          """Test Map.TreeInfo"""          """Test Map.TreeInfo"""
201          proj = Projection(["zone=26", "proj=utm", "ellps=clrk66"])          proj = Projection(["zone=26", "proj=utm", "ellps=clrk66"])
202          self.map.SetProjection(proj)          self.map.SetProjection(proj)
203            # compute the extent string because there are platform
204            # differences in the way %g is handled:
205            # glibc: "%g" % 7.01969e+06 == "7.01969e+06"
206            # w32/VC: "%g" % 7.01969e+06 == "7.01969e+006"
207            extent = 'Extent (projected): (%g, %g, %g, %g)'\
208                     % (608873, 7.01969e+06, 1.17356e+06, 7.44735e+06)
209          self.assertEquals(self.map.TreeInfo(),          self.assertEquals(self.map.TreeInfo(),
210                            ('Map: Test Map',                            ('Map: Test Map',
211                             [('Extent (lat-lon):'                             [('Extent (lat-lon):'
212                               ' (-24.5465, 63.2868, -13.4958, 66.5638)'),                               ' (-24.5465, 63.2868, -13.4958, 66.5638)'),
213                              ('Extent (projected):'                              extent,
                           ' (608873, 7.01969e+06, 1.17356e+06, 7.44735e+06)'),  
214                              ('Projection',                              ('Projection',
215                               ['zone=26', 'proj=utm', 'ellps=clrk66']),                               ['zone=26', 'proj=utm', 'ellps=clrk66']),
216                              self.poly_layer,                              self.poly_layer,
217                              self.arc_layer]))                              self.arc_layer]))
218    
     def test_forwarding_fill(self):  
         """Test Map's forwarding of Layer.SetFill messages"""  
         self.poly_layer.SetFill(Color(0.0, 0.5, 1.0))  
         self.check_messages([(self.poly_layer, LAYER_LEGEND_CHANGED)])  
   
     def test_forwarding_stroke(self):  
         """Test Map's forwarding of Layer.SetStroke messages"""  
         self.poly_layer.SetStroke(Color(0.0, 0.5, 1.0))  
         self.check_messages([(self.poly_layer, LAYER_LEGEND_CHANGED)])  
   
     def test_forwarding_stroke_width(self):  
         """Test Map's forwarding of Layer.SetStrokeWidth messages"""  
         self.poly_layer.SetStrokeWidth(3)  
         self.check_messages([(self.poly_layer, LAYER_LEGEND_CHANGED)])  
   
219      def test_forwarding_visibility(self):      def test_forwarding_visibility(self):
220          """Test Map's forwarding of Layer.SetVisible messages"""          """Test Map's forwarding of Layer.SetVisible messages"""
221          self.poly_layer.SetVisible(0)          self.poly_layer.SetVisible(0)
# Line 238  class TestMapWithContents(TestMapBase, s Line 229  class TestMapWithContents(TestMapBase, s
229          UnsetModified clears the changed flag in the layer as well.          UnsetModified clears the changed flag in the layer as well.
230          """          """
231          self.failIf(self.map.WasModified())          self.failIf(self.map.WasModified())
232          self.poly_layer.SetFill(Color(0.0, 0.5, 1.0))          self.poly_layer.classification.SetDefaultFill(Color(0.0, 0.5, 1.0))
233          self.assert_(self.map.WasModified())          self.assert_(self.map.WasModified())
234          self.map.UnsetModified()          self.map.UnsetModified()
235          self.failIf(self.map.WasModified())          self.failIf(self.map.WasModified())

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26