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

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

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

revision 1646 by bh, Mon Aug 25 13:43:56 2003 UTC revision 1664 by bh, Wed Aug 27 15:20:54 2003 UTC
# Line 82  class LoadSessionTest(support.FileLoadTe Line 82  class LoadSessionTest(support.FileLoadTe
82          self.session = None          self.session = None
83    
84    
85      dtd = "http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"      dtd = "http://thuban.intevation.org/dtds/thuban-0.9.dtd"
86      thubanids = [((dtd, n), (None, "id")) for n in      thubanids = [((dtd, n), (None, "id")) for n in
87                   ["fileshapesource", "filetable", "jointable",                   ["fileshapesource", "filetable", "jointable",
88                    "derivedshapesource"]]                    "derivedshapesource"]]
# Line 170  class TestSingleLayer(LoadSessionTest): Line 170  class TestSingleLayer(LoadSessionTest):
170      file_contents = '''\      file_contents = '''\
171  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
172  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
173  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd"
174          title="single map&amp;layer">          title="single map&amp;layer">
175      <fileshapesource filetype="shapefile" id="D1"      <fileshapesource filetype="shapefile" id="D1"
176          filename="../../Data/iceland/political.shp"/>          filename="../../Data/iceland/political.shp"/>
# Line 231  class TestLayerVisibility(LoadSessionTes Line 231  class TestLayerVisibility(LoadSessionTes
231      file_contents = '''\      file_contents = '''\
232  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
233  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
234  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd"
235          title="single map&amp;layer">          title="single map&amp;layer">
236      <fileshapesource filetype="shapefile" id="D1"      <fileshapesource filetype="shapefile" id="D1"
237          filename="../../Data/iceland/political.shp"/>          filename="../../Data/iceland/political.shp"/>
# Line 356  class TestLabels(ClassificationTest): Line 356  class TestLabels(ClassificationTest):
356      file_contents = '''\      file_contents = '''\
357  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
358  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
359  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd"
360          title="single map&amp;layer">          title="single map&amp;layer">
361      <fileshapesource filetype="shapefile" id="D1"      <fileshapesource filetype="shapefile" id="D1"
362          filename="../../Data/iceland/political.shp"/>          filename="../../Data/iceland/political.shp"/>
# Line 404  class TestLayerProjection(LoadSessionTes Line 404  class TestLayerProjection(LoadSessionTes
404      file_contents = '''\      file_contents = '''\
405  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
406  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
407  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd"
408          title="single map&amp;layer">          title="single map&amp;layer">
409      <fileshapesource filetype="shapefile" id="D2"      <fileshapesource filetype="shapefile" id="D2"
410          filename="../../Data/iceland/roads-line.shp"/>          filename="../../Data/iceland/roads-line.shp"/>
# Line 478  class TestRasterLayer(LoadSessionTest): Line 478  class TestRasterLayer(LoadSessionTest):
478      file_contents = '''\      file_contents = '''\
479  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
480  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
481  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd"
482          title="single map&amp;layer">          title="single map&amp;layer">
483      <map title="Test Map">      <map title="Test Map">
484          <rasterlayer visible="false" filename="../../Data/iceland/island.tif"          <rasterlayer visible="false" filename="../../Data/iceland/island.tif"
# Line 512  class TestJoinedTable(LoadSessionTest): Line 512  class TestJoinedTable(LoadSessionTest):
512    
513      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>
514  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
515  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd" title="A Joined Table session">  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd" title="A Joined Table session">
516      <fileshapesource filetype="shapefile" id="D137227612"      <fileshapesource filetype="shapefile" id="D137227612"
517          filename="../../Data/iceland/roads-line.shp"/>          filename="../../Data/iceland/roads-line.shp"/>
518      <filetable filetype="DBF" filename="load_joinedtable.dbf" id="D136171140"      <filetable filetype="DBF" filename="load_joinedtable.dbf" id="D136171140"
# Line 561  class TestPostGISLayer(LoadSessionTest): Line 561  class TestPostGISLayer(LoadSessionTest):
561    
562      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>
563  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
564  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd"
565          title="unnamed session">          title="unnamed session">
566      <dbconnection port="%(port)s" host="%(host)s" user="%(user)s"      <dbconnection port="%(port)s" host="%(host)s" user="%(user)s"
567          dbtype="postgis" id="D142684948" dbname="%(dbname)s"/>          dbtype="postgis" id="D142684948" dbname="%(dbname)s"/>
# Line 610  class TestPostGISLayerPassword(LoadSessi Line 610  class TestPostGISLayerPassword(LoadSessi
610    
611      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>
612  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
613  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd"
614          title="unnamed session">          title="unnamed session">
615      <dbconnection port="%(port)s" host="%(host)s" user="%(user)s"      <dbconnection port="%(port)s" host="%(host)s" user="%(user)s"
616          dbtype="postgis" id="D142684948" dbname="%(dbname)s"/>          dbtype="postgis" id="D142684948" dbname="%(dbname)s"/>
# Line 705  class TestLoadError(LoadSessionTest): Line 705  class TestLoadError(LoadSessionTest):
705      file_contents = '''\      file_contents = '''\
706  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
707  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">  <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
708  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd"
709          title="single map&amp;layer">          title="single map&amp;layer">
710      <fileshapesource id="D1" filename="../../Data/iceland/political.shp"/>      <fileshapesource id="D1" filename="../../Data/iceland/political.shp"/>
711      <map title="Test Map">      <map title="Test Map">
# Line 732  class TestLoadError(LoadSessionTest): Line 732  class TestLoadError(LoadSessionTest):
732              # LoadError really was about the missing attribute              # LoadError really was about the missing attribute
733              self.assertEquals(str(value),              self.assertEquals(str(value),
734                "Element "                "Element "
735                "(u'http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd',"                "(u'http://thuban.intevation.org/dtds/thuban-0.9.dtd',"
736                " u'fileshapesource') requires an attribute 'filetype'")                " u'fileshapesource') requires an attribute 'filetype'")
737          else:          else:
738              self.fail("Missing filetype attribute doesn't raise LoadError")              self.fail("Missing filetype attribute doesn't raise LoadError")

Legend:
Removed from v.1646  
changed lines
  Added in v.1664

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26