/[thuban]/trunk/thuban/test/test_save.py
ViewVC logotype

Diff of /trunk/thuban/test/test_save.py

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

revision 1677 by bh, Thu Aug 28 13:34:28 2003 UTC revision 1687 by bh, Fri Aug 29 10:02:16 2003 UTC
# Line 178  class SaveSessionTest(unittest.TestCase, Line 178  class SaveSessionTest(unittest.TestCase,
178      def testLayerProjection(self):      def testLayerProjection(self):
179          """Test saving layers with projections"""          """Test saving layers with projections"""
180          # deliberately put an apersand in the title :)          # deliberately put an apersand in the title :)
181          session = Session("single map&layer")          session = self.session = Session("single map&layer")
182          proj = Projection(["zone=26", "proj=utm", "ellps=clrk66"])          proj = Projection(["zone=26", "proj=utm", "ellps=clrk66"])
183          map = Map("Test Map", projection = proj)          map = Map("Test Map", projection = proj)
184          session.AddMap(map)          session.AddMap(map)
# Line 186  class SaveSessionTest(unittest.TestCase, Line 186  class SaveSessionTest(unittest.TestCase,
186          shpfile = os.path.join(os.path.dirname(__file__),          shpfile = os.path.join(os.path.dirname(__file__),
187                                 os.pardir, "Data", "iceland", "political.shp")                                 os.pardir, "Data", "iceland", "political.shp")
188          layer = Layer("My Layer", session.OpenShapefile(shpfile))          layer = Layer("My Layer", session.OpenShapefile(shpfile))
189          proj = Projection(["proj=lcc", "ellps=clrk66"], "Layer Projection")          proj = Projection(["proj=lcc", "ellps=clrk66",
190                               "lat_1=0", "lat_2=20"],
191                              "Layer Projection")
192          layer.SetProjection(proj)          layer.SetProjection(proj)
193          map.AddLayer(layer)          map.AddLayer(layer)
194    
195          filename = self.temp_file_name("save_layerproj.thuban")          filename = self.temp_file_name("save_layerproj.thuban")
196          save_session(session, filename)          save_session(session, filename)
         session.Destroy()  
197    
198          file = open(filename)          file = open(filename)
199          written_contents = file.read()          written_contents = file.read()
# Line 213  class SaveSessionTest(unittest.TestCase, Line 214  class SaveSessionTest(unittest.TestCase,
214                      <projection name="Layer Projection">                      <projection name="Layer Projection">
215                          <parameter value="proj=lcc"/>                          <parameter value="proj=lcc"/>
216                          <parameter value="ellps=clrk66"/>                          <parameter value="ellps=clrk66"/>
217                            <parameter value="lat_1=0"/>
218                            <parameter value="lat_2=20"/>
219                      </projection>                      </projection>
220                  </layer>                  </layer>
221              </map>              </map>

Legend:
Removed from v.1677  
changed lines
  Added in v.1687

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26