/[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 2451 by bh, Mon Dec 13 17:51:11 2004 UTC revision 2458 by frank, Wed Dec 15 09:58:30 2004 UTC
# Line 1016  class TestAltPath(LoadSessionTest): Line 1016  class TestAltPath(LoadSessionTest):
1016      file_contents = '''\      file_contents = '''\
1017  <?xml version="1.0" encoding="UTF-8"?>  <?xml version="1.0" encoding="UTF-8"?>
1018  <!DOCTYPE session SYSTEM "thuban-1.1.dtd">  <!DOCTYPE session SYSTEM "thuban-1.1.dtd">
1019  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.1-dev.dtd" title="Thuban sample session">  <session xmlns="http://thuban.intevation.org/dtds/thuban-1.1-dev.dtd" title="AltPath Test session">
1020      <fileshapesource filetype="shapefile" id="D1108450956" filename="../../Data/iceland/political.shp"/>      <fileshapesource filetype="shapefile" id="D1108450956" filename="../../Data/iceland/political.shp"/>
1021      <fileshapesource filetype="shapefile" id="D1108900076" filename="../Data/iceland/roads-line.shp"/>      <fileshapesource filetype="shapefile" id="D1108900076" filename="../Data/iceland/roads-line.shp"/>
1022      <fileshapesource filetype="shapefile" id="D1108947244" filename="../../Data/iceland/cultural_landmark-point.shp"/>      <fileshapesource filetype="shapefile" id="D1108947244" filename="../../Data/iceland/cultural_landmark-point.shp"/>
# Line 1028  class TestAltPath(LoadSessionTest): Line 1028  class TestAltPath(LoadSessionTest):
1028  </session>  </session>
1029  '''  '''
1030    
1031        def checkSession(self, session):
1032            """Check if session has been loaded successfully."""
1033            
1034            eq = self.assertEquals
1035    
1036            map = session.Maps()[0]
1037            layers = map.Layers()
1038    
1039            eq("AltPath Test session", session.Title())
1040            eq("not the iceland map", map.Title())
1041            eq(3,len(layers))
1042            eq("political",layers[0].Title())
1043            eq("roads-line",layers[1].Title())
1044            eq("something else",layers[2].Title())
1045    
1046      def test_01_single_path_error_fix(self):      def test_01_single_path_error_fix(self):
1047          """Test single file path error fix."""          """Test single file path error fix."""
1048          # The usual initial case          # The usual initial case
# Line 1036  class TestAltPath(LoadSessionTest): Line 1051  class TestAltPath(LoadSessionTest):
1051                      "check": [(None, None)]})                      "check": [(None, None)]})
1052          self.session = load_session(self.filename(),          self.session = load_session(self.filename(),
1053                                      shapefile_callback =s_cb.s_cb)                                      shapefile_callback =s_cb.s_cb)
1054            self.checkSession(self.session)
1055            
1056      def test_02_path_error_fix_from_list(self):      def test_02_path_error_fix_from_list(self):
1057          """Test single file path error fix."""          """Test single file path error fix."""
1058          # This represents the usual case for "from_list"          # This represents the usual case for "from_list"
# Line 1046  class TestAltPath(LoadSessionTest): Line 1062  class TestAltPath(LoadSessionTest):
1062                 })                 })
1063          self.session = load_session(self.filename(),          self.session = load_session(self.filename(),
1064                                      shapefile_callback =s_cb.s_cb)                                      shapefile_callback =s_cb.s_cb)
1065            self.checkSession(self.session)
1066    
1067      def test_03_single_path_error_cancelled(self):      def test_03_single_path_error_cancelled(self):
1068          """Test alternative path cancelled."""          """Test alternative path cancelled."""
# Line 1072  class TestAltPath(LoadSessionTest): Line 1089  class TestAltPath(LoadSessionTest):
1089                 })                 })
1090          self.session = load_session(self.filename(),          self.session = load_session(self.filename(),
1091                                      shapefile_callback =s_cb.s_cb)                                      shapefile_callback =s_cb.s_cb)
1092            self.checkSession(self.session)
1093    
1094      def test_06_path_error_fix_from_list_fails(self):      def test_06_path_error_fix_from_list_fails(self):
1095          """Test alternative path recovery from list."""          """Test alternative path recovery from list."""

Legend:
Removed from v.2451  
changed lines
  Added in v.2458

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26