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

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

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

revision 723 by bh, Thu Apr 24 15:31:53 2003 UTC revision 851 by bh, Wed May 7 15:11:12 2003 UTC
# Line 38  class TestSessionSimple(unittest.TestCas Line 38  class TestSessionSimple(unittest.TestCas
38          session = Session("Test Session")          session = Session("Test Session")
39          self.assertEquals(session.Title(), "Test Session")          self.assertEquals(session.Title(), "Test Session")
40          self.assertEquals(session.Maps(), [])          self.assertEquals(session.Maps(), [])
41            self.assertEquals(session.Tables(), [])
42            self.assertEquals(session.ShapeStores(), [])
43          self.assertEquals(session.filename, None)          self.assertEquals(session.filename, None)
44          self.failIf(session.HasMaps())          self.failIf(session.HasMaps())
45          self.failIf(session.WasModified())          self.failIf(session.WasModified())
# Line 207  class TestSessionWithContent(TestSession Line 209  class TestSessionWithContent(TestSession
209                               (self.session, CHANGED),                               (self.session, CHANGED),
210                               (CHANGED,)])                               (CHANGED,)])
211    
212        def test_shape_stores(self):
213            """Test Session.ShapeStores()"""
214            # Strictly speaking the session doesn't make guarantees about
215            # the order of the ShapeStores in the list, but currently it's
216            # deterministic and they're listed in the order in which they
217            # were created
218            self.assertEquals(self.session.ShapeStores(),
219                              [self.arc_layer.ShapeStore(),
220                               self.poly_layer.ShapeStore()])
221            # If we remove the map from the session and clear our instance
222            # variables that hold the layers and the map the list should
223            # become empty again.
224            self.session.RemoveMap(self.map)
225            self.arc_layer = self.poly_layer = self.map = None
226            self.assertEquals(self.session.ShapeStores(), [])
227    
228        def test_tables(self):
229            """Test Session.Tables()"""
230            # Strictly speaking the session doesn't make guarantees about
231            # the order of the tables in the list, but currently it's
232            # deterministic and they're listed in the order in which they
233            # were opened
234            self.assertEquals(self.session.Tables(),
235                              [self.arc_layer.ShapeStore().Table(),
236                               self.poly_layer.ShapeStore().Table()])
237            # If we remove the map from the session and clear our instance
238            # variables that hold the layers and the map the list should
239            # become empty again.
240            self.session.RemoveMap(self.map)
241            self.arc_layer = self.poly_layer = self.map = None
242            self.assertEquals(self.session.Tables(), [])
243    
244    
245  if __name__ == "__main__":  if __name__ == "__main__":
246      unittest.main()      unittest.main()

Legend:
Removed from v.723  
changed lines
  Added in v.851

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26