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()) |
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() |