80 |
self.session = None |
self.session = None |
81 |
|
|
82 |
|
|
83 |
dtd = "http://thuban.intevation.org/dtds/thuban-0.8.dtd" |
dtd = "http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd" |
84 |
thubanids = [((dtd, n), (None, "id")) for n in |
thubanids = [((dtd, n), (None, "id")) for n in |
85 |
["fileshapesource", "filetable", "jointable", |
["fileshapesource", "filetable", "jointable", |
86 |
"derivedshapesource"]] |
"derivedshapesource"]] |
167 |
|
|
168 |
file_contents = '''\ |
file_contents = '''\ |
169 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
170 |
<!DOCTYPE session SYSTEM "thuban-0.8.dtd"> |
<!DOCTYPE session SYSTEM "thuban-0.9.dtd"> |
171 |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.8.dtd" |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd" |
172 |
title="single map&layer"> |
title="single map&layer"> |
173 |
<fileshapesource filetype="shapefile" id="D1" |
<fileshapesource filetype="shapefile" id="D1" |
174 |
filename="../../Data/iceland/political.shp"/> |
filename="../../Data/iceland/political.shp"/> |
228 |
|
|
229 |
file_contents = '''\ |
file_contents = '''\ |
230 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
231 |
<!DOCTYPE session SYSTEM "thuban-0.8.dtd"> |
<!DOCTYPE session SYSTEM "thuban-0.9.dtd"> |
232 |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.8.dtd" |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd" |
233 |
title="single map&layer"> |
title="single map&layer"> |
234 |
<fileshapesource filetype="shapefile" id="D1" |
<fileshapesource filetype="shapefile" id="D1" |
235 |
filename="../../Data/iceland/political.shp"/> |
filename="../../Data/iceland/political.shp"/> |
347 |
|
|
348 |
file_contents = '''\ |
file_contents = '''\ |
349 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
350 |
<!DOCTYPE session SYSTEM "thuban-0.8.dtd"> |
<!DOCTYPE session SYSTEM "thuban-0.9.dtd"> |
351 |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.8.dtd" |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd" |
352 |
title="single map&layer"> |
title="single map&layer"> |
353 |
<fileshapesource filetype="shapefile" id="D1" |
<fileshapesource filetype="shapefile" id="D1" |
354 |
filename="../../Data/iceland/political.shp"/> |
filename="../../Data/iceland/political.shp"/> |
395 |
|
|
396 |
file_contents = '''\ |
file_contents = '''\ |
397 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
398 |
<!DOCTYPE session SYSTEM "thuban-0.8.dtd"> |
<!DOCTYPE session SYSTEM "thuban-0.9.dtd"> |
399 |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.8.dtd" |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd" |
400 |
title="single map&layer"> |
title="single map&layer"> |
401 |
<fileshapesource filetype="shapefile" id="D2" |
<fileshapesource filetype="shapefile" id="D2" |
402 |
filename="../../Data/iceland/roads-line.shp"/> |
filename="../../Data/iceland/roads-line.shp"/> |
469 |
|
|
470 |
file_contents = '''\ |
file_contents = '''\ |
471 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
472 |
<!DOCTYPE session SYSTEM "thuban-0.8.dtd"> |
<!DOCTYPE session SYSTEM "thuban-0.9.dtd"> |
473 |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.8.dtd" |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd" |
474 |
title="single map&layer"> |
title="single map&layer"> |
475 |
<map title="Test Map"> |
<map title="Test Map"> |
476 |
<rasterlayer visible="false" filename="../../Data/iceland/island.tif" |
<rasterlayer visible="false" filename="../../Data/iceland/island.tif" |
503 |
class TestJoinedTable(LoadSessionTest): |
class TestJoinedTable(LoadSessionTest): |
504 |
|
|
505 |
file_contents = '''<?xml version="1.0" encoding="UTF-8"?> |
file_contents = '''<?xml version="1.0" encoding="UTF-8"?> |
506 |
<!DOCTYPE session SYSTEM "thuban-0.8.dtd"> |
<!DOCTYPE session SYSTEM "thuban-0.9.dtd"> |
507 |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.8.dtd" title="A Joined Table session"> |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd" title="A Joined Table session"> |
508 |
<fileshapesource filetype="shapefile" id="D137227612" |
<fileshapesource filetype="shapefile" id="D137227612" |
509 |
filename="../../Data/iceland/roads-line.shp"/> |
filename="../../Data/iceland/roads-line.shp"/> |
510 |
<filetable filetype="DBF" filename="load_joinedtable.dbf" id="D136171140" |
<filetable filetype="DBF" filename="load_joinedtable.dbf" id="D136171140" |
511 |
title="Some Title"/> |
title="Some Title"/> |
512 |
<jointable leftcolumn="RDLNTYPE" right="D136171140" |
<jointable id="D136169900" title="Joined" |
513 |
title="Joined" rightcolumn="RDTYPE" id="D136169900" left="D137227612"/> |
right="D136171140" left="D137227612" |
514 |
|
leftcolumn="RDLNTYPE" rightcolumn="RDTYPE" |
515 |
|
jointype="LEFT OUTER"/> |
516 |
<derivedshapesource table="D136169900" shapesource="D137227612" |
<derivedshapesource table="D136169900" shapesource="D137227612" |
517 |
id="D136170932"/> |
id="D136170932"/> |
518 |
<map title="Test Map"> |
<map title="Test Map"> |
544 |
# FIXME: The tests shouldn't assume a certain order of the tables |
# FIXME: The tests shouldn't assume a certain order of the tables |
545 |
self.assertEquals(tables[0].Title(), "Some Title") |
self.assertEquals(tables[0].Title(), "Some Title") |
546 |
self.assertEquals(tables[1].Title(), "Joined") |
self.assertEquals(tables[1].Title(), "Joined") |
547 |
|
self.assertEquals(tables[1].JoinType(), "LEFT OUTER") |
548 |
self.check_format() |
self.check_format() |
549 |
|
|
550 |
|
|
552 |
|
|
553 |
file_contents = '''\ |
file_contents = '''\ |
554 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
555 |
<!DOCTYPE session SYSTEM "thuban-0.8.dtd"> |
<!DOCTYPE session SYSTEM "thuban-0.9.dtd"> |
556 |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.8.dtd" |
<session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd" |
557 |
title="single map&layer"> |
title="single map&layer"> |
558 |
<fileshapesource id="D1" filename="../../Data/iceland/political.shp"/> |
<fileshapesource id="D1" filename="../../Data/iceland/political.shp"/> |
559 |
<map title="Test Map"> |
<map title="Test Map"> |