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

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

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

revision 1640 by bh, Fri Aug 22 18:24:44 2003 UTC revision 1664 by bh, Wed Aug 27 15:20:54 2003 UTC
# Line 65  class XMLWriterTest(unittest.TestCase): Line 65  class XMLWriterTest(unittest.TestCase):
65  class SaveSessionTest(unittest.TestCase, support.FileTestMixin,  class SaveSessionTest(unittest.TestCase, support.FileTestMixin,
66                        xmlsupport.ValidationTest):                        xmlsupport.ValidationTest):
67    
68      dtd = "http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd"      dtd = "http://thuban.intevation.org/dtds/thuban-0.9.dtd"
69      thubanids = [((dtd, n), (None, "id")) for n in      thubanids = [((dtd, n), (None, "id")) for n in
70                   ["fileshapesource", "filetable", "jointable",                   ["fileshapesource", "filetable", "jointable",
71                    "derivedshapesource", "dbshapesource", "dbconnection"]]                    "derivedshapesource", "dbshapesource", "dbconnection"]]
# Line 103  class SaveSessionTest(unittest.TestCase, Line 103  class SaveSessionTest(unittest.TestCase,
103                           '<?xml version="1.0" encoding="UTF-8"?>\n'                           '<?xml version="1.0" encoding="UTF-8"?>\n'
104                           '<!DOCTYPE session SYSTEM "thuban-0.9.dtd">\n'                           '<!DOCTYPE session SYSTEM "thuban-0.9.dtd">\n'
105                           '<session title="empty session" '                           '<session title="empty session" '
106           'xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd">'           'xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd">'
107                           '\n</session>\n')                           '\n</session>\n')
108    
109          self.validate_data(written_contents)          self.validate_data(written_contents)
# Line 130  class SaveSessionTest(unittest.TestCase, Line 130  class SaveSessionTest(unittest.TestCase,
130          expected_template = '''<?xml version="1.0" encoding="UTF-8"?>          expected_template = '''<?xml version="1.0" encoding="UTF-8"?>
131          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
132          <session title="single map&amp;layer"          <session title="single map&amp;layer"
133             xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd">             xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd">
134              <fileshapesource id="D1" filename="%s" filetype="shapefile"/>              <fileshapesource id="D1" filename="%s" filetype="shapefile"/>
135              <map title="Test Map">              <map title="Test Map">
136                  <projection name="Unknown">                  <projection name="Unknown">
# Line 190  class SaveSessionTest(unittest.TestCase, Line 190  class SaveSessionTest(unittest.TestCase,
190          expected_contents = '''<?xml version="1.0" encoding="UTF-8"?>          expected_contents = '''<?xml version="1.0" encoding="UTF-8"?>
191          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
192          <session title="single map&amp;layer"          <session title="single map&amp;layer"
193             xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd">             xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd">
194              <fileshapesource id="D1" filename="%s" filetype="shapefile"/>              <fileshapesource id="D1" filename="%s" filetype="shapefile"/>
195              <map title="Test Map">              <map title="Test Map">
196                  <projection name="Unknown">                  <projection name="Unknown">
# Line 236  class SaveSessionTest(unittest.TestCase, Line 236  class SaveSessionTest(unittest.TestCase,
236          expected_contents = '''<?xml version="1.0" encoding="UTF-8"?>          expected_contents = '''<?xml version="1.0" encoding="UTF-8"?>
237          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
238          <session title="single map&amp;layer"          <session title="single map&amp;layer"
239             xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd">             xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd">
240              <map title="Test Map">              <map title="Test Map">
241                  <rasterlayer title="My RasterLayer" filename="%s"                  <rasterlayer title="My RasterLayer" filename="%s"
242                               visible="true">                               visible="true">
# Line 303  class SaveSessionTest(unittest.TestCase, Line 303  class SaveSessionTest(unittest.TestCase,
303          expected_template = '''<?xml version="1.0" encoding="UTF-8"?>          expected_template = '''<?xml version="1.0" encoding="UTF-8"?>
304          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
305          <session title="Map with Classifications"          <session title="Map with Classifications"
306             xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd">             xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd">
307              <fileshapesource id="D1" filename="%s" filetype="shapefile"/>              <fileshapesource id="D1" filename="%s" filetype="shapefile"/>
308              <map title="Test Map">              <map title="Test Map">
309                  <projection name="Unknown">                  <projection name="Unknown">
# Line 376  class SaveSessionTest(unittest.TestCase, Line 376  class SaveSessionTest(unittest.TestCase,
376          expected_template = '''<?xml version="1.0" encoding="UTF-8"?>          expected_template = '''<?xml version="1.0" encoding="UTF-8"?>
377          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">          <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
378          <session title="a DBF Table session"          <session title="a DBF Table session"
379             xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd">             xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd">
380              <filetable id="D1" filename="%s" filetype="DBF" title="political"/>              <filetable id="D1" filename="%s" filetype="DBF" title="political"/>
381          </session>'''          </session>'''
382    
# Line 436  class SaveSessionTest(unittest.TestCase, Line 436  class SaveSessionTest(unittest.TestCase,
436              expected_template = '''<?xml version="1.0" encoding="UTF-8"?>              expected_template = '''<?xml version="1.0" encoding="UTF-8"?>
437              <!DOCTYPE session SYSTEM "thuban-0.9.dtd">              <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
438              <session title="A Joined Table session"              <session title="A Joined Table session"
439               xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd">               xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd">
440                  <fileshapesource filename="%(shpfile)s"                  <fileshapesource filename="%(shpfile)s"
441                                   filetype="shapefile" id="D142197204"/>                                   filetype="shapefile" id="D142197204"/>
442                  <filetable filename="%(dbffile)s"                  <filetable filename="%(dbffile)s"
# Line 504  class SaveSessionTest(unittest.TestCase, Line 504  class SaveSessionTest(unittest.TestCase,
504              expected = '''<?xml version="1.0" encoding="UTF-8"?>              expected = '''<?xml version="1.0" encoding="UTF-8"?>
505              <!DOCTYPE session SYSTEM "thuban-0.9.dtd">              <!DOCTYPE session SYSTEM "thuban-0.9.dtd">
506              <session title="A PostGIS Session"              <session title="A PostGIS Session"
507               xmlns="http://thuban.intevation.org/dtds/thuban-0.9-dev.dtd">               xmlns="http://thuban.intevation.org/dtds/thuban-0.9.dtd">
508                  <dbconnection id="DB"                  <dbconnection id="DB"
509                                dbtype="postgis" dbname="plugh"                                dbtype="postgis" dbname="plugh"
510                                host="xyzzy" port="42"                                host="xyzzy" port="42"

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26