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

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

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

revision 1664 by bh, Wed Aug 27 15:20:54 2003 UTC revision 1678 by bh, Thu Aug 28 13:36:23 2003 UTC
# Line 78  class SaveSessionTest(unittest.TestCase, Line 78  class SaveSessionTest(unittest.TestCase,
78                       ("dbshapesource", "dbconn")]]                       ("dbshapesource", "dbconn")]]
79      del n, m, dtd      del n, m, dtd
80    
81        def tearDown(self):
82            """Call self.session.Destroy
83    
84            Test cases that create session should bind it to self.session so
85            that it gets destroyed properly
86            """
87            if hasattr(self, "session"):
88                self.session.Destroy()
89                self.session = None
90    
91      def compare_xml(self, xml1, xml2):      def compare_xml(self, xml1, xml2):
92          list1 = xmlsupport.sax_eventlist(xml1, ids = self.thubanids,          list1 = xmlsupport.sax_eventlist(xml1, ids = self.thubanids,
93                                           idrefs = self.thubanidrefs)                                           idrefs = self.thubanidrefs)
# Line 168  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 182  class SaveSessionTest(unittest.TestCase, Line 192  class SaveSessionTest(unittest.TestCase,
192    
193          filename = self.temp_file_name("save_layerproj.thuban")          filename = self.temp_file_name("save_layerproj.thuban")
194          save_session(session, filename)          save_session(session, filename)
         session.Destroy()  
195    
196          file = open(filename)          file = open(filename)
197          written_contents = file.read()          written_contents = file.read()
# Line 361  class SaveSessionTest(unittest.TestCase, Line 370  class SaveSessionTest(unittest.TestCase,
370    
371      def test_dbf_table(self):      def test_dbf_table(self):
372          """Test saving a session with a dbf table link"""          """Test saving a session with a dbf table link"""
373          session = Session("a DBF Table session")          session = self.session = Session("a DBF Table session")
374          # use shapefile from the example data          # use shapefile from the example data
375          dbffile = os.path.join(os.path.dirname(__file__),          dbffile = os.path.join(os.path.dirname(__file__),
376                                 os.pardir, "Data", "iceland", "political.dbf")                                 os.pardir, "Data", "iceland", "political.dbf")

Legend:
Removed from v.1664  
changed lines
  Added in v.1678

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26