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

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

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

revision 765 by bh, Tue Apr 29 12:42:14 2003 UTC revision 774 by jonathan, Tue Apr 29 14:34:45 2003 UTC
# Line 175  contents_test_layer_projection = '''\ Line 175  contents_test_layer_projection = '''\
175  </session>  </session>
176  '''  '''
177    
178    contents_test_visible = '''\
179    <?xml version="1.0" encoding="UTF-8"?>
180    <!DOCTYPE session SYSTEM "thuban.dtd">
181    <session title="single map&amp;layer">
182            <map title="Test Map">
183                    <projection>
184                            <parameter value="zone=26"/>
185                            <parameter value="proj=utm"/>
186                            <parameter value="ellps=clrk66"/>
187                    </projection>
188                    <layer title="My Layer" stroke_width="1" fill="None"
189                        filename="../../Data/iceland/political.shp"
190                        stroke="#000000" visible="false">
191            </layer>
192        </map>
193    </session>
194    '''
195    
196  class LoadSessionTest(unittest.TestCase, support.FileTestMixin):  class LoadSessionTest(unittest.TestCase, support.FileTestMixin):
197    
198      def setUp(self):      def setUp(self):
# Line 195  class LoadSessionTest(unittest.TestCase, Line 213  class LoadSessionTest(unittest.TestCase,
213          file.write(contents_test_layer_projection)          file.write(contents_test_layer_projection)
214          file.close()          file.close()
215    
216            file = open(self.temp_file_name("load_visible.thuban"), "w")
217            file.write(contents_test_visible)
218            file.close()
219    
220          self.session = None          self.session = None
221    
222      def tearDown(self):      def tearDown(self):
# Line 233  class LoadSessionTest(unittest.TestCase, Line 255  class LoadSessionTest(unittest.TestCase,
255                                                       "political.shp")))                                                       "political.shp")))
256          eq(layer.GetClassification().GetDefaultFill(), Color.Transparent)          eq(layer.GetClassification().GetDefaultFill(), Color.Transparent)
257          eq(layer.GetClassification().GetDefaultLineColor().hex(), "#000000")          eq(layer.GetClassification().GetDefaultLineColor().hex(), "#000000")
258            eq(layer.Visible(), True)
259    
260          self.session.Destroy()          self.session.Destroy()
261          self.session = None          self.session = None
262    
263        def testLayerVisibility(self):
264            """Test that the visible flag is correctly loaded for a layer."""
265    
266            eq = self.assertEquals
267            session = load_session(self.temp_file_name("load_visible.thuban"))
268            self.session = session
269            maps = session.Maps()
270            eq(len(maps), 1)
271            map = maps[0]
272            layers = map.Layers()
273            eq(len(layers), 1)
274            layer = layers[0]
275    
276            eq(layer.Visible(), False)
277    
278      def testClassification(self):      def testClassification(self):
279          """Load a session with a map and classified layers."""          """Load a session with a map and classified layers."""
280    

Legend:
Removed from v.765  
changed lines
  Added in v.774

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26