229 |
As currently written this only works on unix-like systems and |
As currently written this only works on unix-like systems and |
230 |
not e.g. on MS Windows. |
not e.g. on MS Windows. |
231 |
""" |
""" |
232 |
|
if os.name != "posix": |
233 |
|
raise support.SkipTest("Test only works on posix systems") |
234 |
filename = self.filename() |
filename = self.filename() |
235 |
file = open(filename, "w") |
file = open(filename, "w") |
236 |
file.close() |
file.close() |
246 |
self.assertRaises(SAXParseException, resource.read_proj_file, filename) |
self.assertRaises(SAXParseException, resource.read_proj_file, filename) |
247 |
|
|
248 |
def test_get_system_proj_file(self): |
def test_get_system_proj_file(self): |
249 |
"""Test resource.get_system_proj_file() |
"""Test resource.get_system_proj_file(DEFAULT_PROJ_FILE) |
250 |
|
|
251 |
This is primarily to test whether the system proj file contains |
This is primarily to test whether the system proj file contains |
252 |
invalid projection paramers and whether the proj file is not |
invalid projection paramers and whether the proj file is not |
253 |
empty |
empty |
254 |
""" |
""" |
255 |
projfile, warnings = resource.get_system_proj_file() |
projfile, warnings\ |
256 |
|
= resource.get_system_proj_file(resource.DEFAULT_PROJ_FILE) |
257 |
self.assertEquals(warnings, []) |
self.assertEquals(warnings, []) |
258 |
self.assert_(len(projfile.GetProjections()) > 0) |
self.assert_(len(projfile.GetProjections()) > 0) |
259 |
|
|
260 |
# see whether it got cached and we get the same projfile object |
# see whether it got cached and we get the same projfile object |
261 |
# when we read the file again |
# when we read the file again |
262 |
projfile2, warnings = resource.get_system_proj_file() |
projfile2, warnings \ |
263 |
|
= resource.get_system_proj_file(resource.DEFAULT_PROJ_FILE) |
264 |
self.assert_(projfile is projfile2) |
self.assert_(projfile is projfile2) |
265 |
|
|
266 |
|
|