/[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 292 by bh, Fri Aug 30 09:44:12 2002 UTC revision 530 by jonathan, Wed Mar 12 19:58:00 2003 UTC
# Line 19  from StringIO import StringIO Line 19  from StringIO import StringIO
19    
20  import xml.sax  import xml.sax
21  import xml.sax.handler  import xml.sax.handler
22  from xml.sax import make_parser, ErrorHandler  from xml.sax import make_parser, ErrorHandler, SAXNotRecognizedException
23    
24  import support  import support
25  support.initthuban()  support.initthuban()
# Line 54  def sax_eventlist(data): Line 54  def sax_eventlist(data):
54      parser.setErrorHandler(ErrorHandler())      parser.setErrorHandler(ErrorHandler())
55      parser.setFeature(xml.sax.handler.feature_namespaces, 1)      parser.setFeature(xml.sax.handler.feature_namespaces, 1)
56    
57        #
58        # see comment at the end of Thuban/Model/load.py
59        #
60        try:
61            parser.setFeature(xml.sax.handler.feature_validation, 0)
62            parser.setFeature(xml.sax.handler.feature_external_ges, 0)
63            parser.setFeature(xml.sax.handler.feature_external_pes, 0)
64        except SAXNotRecognizedException:
65            pass
66    
67      inpsrc = xml.sax.InputSource()      inpsrc = xml.sax.InputSource()
68      inpsrc.setByteStream(StringIO(data))      inpsrc.setByteStream(StringIO(data))
69      parser.parse(inpsrc)      parser.parse(inpsrc)
# Line 114  class SaveSessionTest(unittest.TestCase, Line 124  class SaveSessionTest(unittest.TestCase,
124              </map>              </map>
125          </session>''' % os.path.join("..", "..", "Data", "iceland",          </session>''' % os.path.join("..", "..", "Data", "iceland",
126                                       "political.shp")                                       "political.shp")
127            #print written_contents
128            #print "********************************************"
129            #print expected_contents
130          self.compare_xml(written_contents, expected_contents)          self.compare_xml(written_contents, expected_contents)
131    
132    

Legend:
Removed from v.292  
changed lines
  Added in v.530

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26