/[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 1976 by bh, Tue Nov 25 14:26:08 2003 UTC revision 2004 by bh, Tue Dec 2 13:25:55 2003 UTC
# Line 87  class LoadSessionTest(support.FileLoadTe Line 87  class LoadSessionTest(support.FileLoadTe
87          self.session = None          self.session = None
88    
89    
90      dtd = "http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"      dtd = "http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
91      thubanids = [((dtd, n), (None, "id")) for n in      thubanids = [((dtd, n), (None, "id")) for n in
92                   ["fileshapesource", "filetable", "jointable",                   ["fileshapesource", "filetable", "jointable",
93                    "derivedshapesource"]]                    "derivedshapesource"]]
# Line 97  class LoadSessionTest(support.FileLoadTe Line 97  class LoadSessionTest(support.FileLoadTe
97                       ("jointable", "right"),                       ("jointable", "right"),
98                       ("derivedshapesource", "table"),                       ("derivedshapesource", "table"),
99                       ("derivedshapesource", "shapesource")]]                       ("derivedshapesource", "shapesource")]]
100      filenames = [((dtd, n), (None, m)) for n, m in  
101                   [("fileshapesource", "filename"),      # The filenames in the tests should be understandable on all
102                    ("rasterlayer", "filename"),      # currently supported platforms so filenames is an empty list
103                    ("filetable", "filename")]]      filenames = []
104    
105      del n, m, dtd      del n, m, dtd
106    
107      def check_format(self):      def check_format(self):
# Line 183  class TestSingleLayer(LoadSessionTest): Line 184  class TestSingleLayer(LoadSessionTest):
184      file_contents = '''\      file_contents = '''\
185  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
186  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
187  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
188          title="Stra\xc3\x9fen &amp; Landmarken">          title="Stra\xc3\x9fen &amp; Landmarken">
189      <fileshapesource filetype="shapefile" id="D1"      <fileshapesource filetype="shapefile" id="D1"
190          filename="../../Data/iceland/political.shp"/>          filename="../../Data/iceland/political.shp"/>
# Line 275  class TestNonAsciiColumnName(LoadSession Line 276  class TestNonAsciiColumnName(LoadSession
276      file_contents = '''\      file_contents = '''\
277  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
278  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
279  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
280          title="Non ASCII column name test">          title="Non ASCII column name test">
281      <fileshapesource filetype="shapefile" id="D1"      <fileshapesource filetype="shapefile" id="D1"
282          filename="TestNonAsciiColumnName.shp"/>          filename="TestNonAsciiColumnName.shp"/>
# Line 352  class TestLayerVisibility(LoadSessionTes Line 353  class TestLayerVisibility(LoadSessionTes
353      file_contents = '''\      file_contents = '''\
354  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
355  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
356  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
357          title="single map&amp;layer">          title="single map&amp;layer">
358      <fileshapesource filetype="shapefile" id="D1"      <fileshapesource filetype="shapefile" id="D1"
359          filename="../../Data/iceland/political.shp"/>          filename="../../Data/iceland/political.shp"/>
# Line 390  class TestClassification(ClassificationT Line 391  class TestClassification(ClassificationT
391      file_contents = '''\      file_contents = '''\
392  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
393  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
394  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
395          title="single map&amp;layer">          title="single map&amp;layer">
396      <fileshapesource filetype="shapefile" id="D138389860"      <fileshapesource filetype="shapefile" id="D138389860"
397          filename="../../Data/iceland/political.shp"/>          filename="../../Data/iceland/political.shp"/>
# Line 482  class TestLabels(ClassificationTest): Line 483  class TestLabels(ClassificationTest):
483      file_contents = '''\      file_contents = '''\
484  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
485  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
486  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
487          title="single map&amp;layer">          title="single map&amp;layer">
488      <fileshapesource filetype="shapefile" id="D1"      <fileshapesource filetype="shapefile" id="D1"
489          filename="../../Data/iceland/political.shp"/>          filename="../../Data/iceland/political.shp"/>
# Line 530  class TestLayerProjection(LoadSessionTes Line 531  class TestLayerProjection(LoadSessionTes
531      file_contents = '''\      file_contents = '''\
532  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
533  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
534  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
535          title="single map&amp;layer">          title="single map&amp;layer">
536      <fileshapesource filetype="shapefile" id="D2"      <fileshapesource filetype="shapefile" id="D2"
537          filename="../../Data/iceland/roads-line.shp"/>          filename="../../Data/iceland/roads-line.shp"/>
# Line 608  class TestRasterLayer(LoadSessionTest): Line 609  class TestRasterLayer(LoadSessionTest):
609      file_contents = '''\      file_contents = '''\
610  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
611  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
612  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
613          title="single map&amp;layer">          title="single map&amp;layer">
614      <map title="Test Map">      <map title="Test Map">
615          <rasterlayer visible="false" filename="../../Data/iceland/island.tif"          <rasterlayer visible="false" filename="../../Data/iceland/island.tif"
# Line 642  class TestJoinedTable(LoadSessionTest): Line 643  class TestJoinedTable(LoadSessionTest):
643    
644      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>
645  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
646  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd" title="A Joined Table session">  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd" title="A Joined Table session">
647      <fileshapesource filetype="shapefile" id="D137227612"      <fileshapesource filetype="shapefile" id="D137227612"
648          filename="../../Data/iceland/roads-line.shp"/>          filename="../../Data/iceland/roads-line.shp"/>
649      <filetable filetype="DBF" filename="load_joinedtable.dbf" id="D136171140"      <filetable filetype="DBF" filename="load_joinedtable.dbf" id="D136171140"
# Line 691  class TestPostGISLayer(LoadSessionTest): Line 692  class TestPostGISLayer(LoadSessionTest):
692    
693      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>
694  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
695  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
696          title="unnamed session">          title="unnamed session">
697      <dbconnection port="%(port)s" host="%(host)s" user="%(user)s"      <dbconnection port="%(port)s" host="%(host)s" user="%(user)s"
698          dbtype="postgis" id="D142684948" dbname="%(dbname)s"/>          dbtype="postgis" id="D142684948" dbname="%(dbname)s"/>
# Line 740  class TestPostGISLayerPassword(LoadSessi Line 741  class TestPostGISLayerPassword(LoadSessi
741    
742      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>      file_contents = '''<?xml version="1.0" encoding="UTF-8"?>
743  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
744  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
745          title="unnamed session">          title="unnamed session">
746      <dbconnection port="%(port)s" host="%(host)s" user="%(user)s"      <dbconnection port="%(port)s" host="%(host)s" user="%(user)s"
747          dbtype="postgis" id="D142684948" dbname="%(dbname)s"/>          dbtype="postgis" id="D142684948" dbname="%(dbname)s"/>
# Line 835  class TestLoadError(LoadSessionTest): Line 836  class TestLoadError(LoadSessionTest):
836      file_contents = '''\      file_contents = '''\
837  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
838  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">  <!DOCTYPE session SYSTEM "thuban-1.0.dtd">
839  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd"  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd"
840          title="single map&amp;layer">          title="single map&amp;layer">
841      <fileshapesource id="D1" filename="../../Data/iceland/political.shp"/>      <fileshapesource id="D1" filename="../../Data/iceland/political.shp"/>
842      <map title="Test Map">      <map title="Test Map">
# Line 862  class TestLoadError(LoadSessionTest): Line 863  class TestLoadError(LoadSessionTest):
863              # LoadError really was about the missing attribute              # LoadError really was about the missing attribute
864              self.assertEquals(str(value),              self.assertEquals(str(value),
865                "Element "                "Element "
866                "(u'http://thuban.intevation.org/dtds/thuban-1.0-dev.dtd',"                "(u'http://thuban.intevation.org/dtds/thuban-1.0rc1.dtd',"
867                " u'fileshapesource') requires an attribute 'filetype'")                " u'fileshapesource') requires an attribute 'filetype'")
868          else:          else:
869              self.fail("Missing filetype attribute doesn't raise LoadError")              self.fail("Missing filetype attribute doesn't raise LoadError")

Legend:
Removed from v.1976  
changed lines
  Added in v.2004

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26