~therve/python/issue2982

« back to all changes in this revision

Viewing changes to Lib/test/test_pyexpat.py

  • Committer: Thomas Hervé
  • Date: 2008-05-31 14:46:46 UTC
  • Revision ID: therve@free.fr-20080531144646-oz22voi9y7j502dv
One more test for NotStandaloneHandler not called.

Show diffs side-by-side

added added

removed removed

Lines of Context:
343
343
 
344
344
        self.assertRaises(TypeError, parser.ParseFile, file)
345
345
 
 
346
    def test_NotStandaloneHandlerNotUsed(self):
 
347
        out = self.Outputter()
 
348
        parser = expat.ParserCreate(namespace_separator='!')
 
349
        parser.returns_unicode = 1
 
350
        def handler():
 
351
            return 0
 
352
        parser.NotStandaloneHandler = handler
 
353
        data = """\
 
354
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
 
355
<!DOCTYPE quotations SYSTEM "quotations.dtd" [
 
356
<!ELEMENT root ANY>
 
357
]>
 
358
<root />
 
359
        """
 
360
        file = StringIO.StringIO(data)
 
361
 
 
362
        parser.ParseFile(file)
 
363
 
346
364
 
347
365
class NamespaceSeparatorTest(unittest.TestCase):
348
366
    def test_legal(self):