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