Back to index

python3.2  3.2.2
Classes | Public Member Functions
test.test_sax.ErrorReportingTest Class Reference

List of all members.

Classes

class  DummyLocator

Public Member Functions

def test_expat_inpsource_location
def test_expat_incomplete
def test_sax_parse_exception_str

Detailed Description

Definition at line 704 of file test_sax.py.


Member Function Documentation

Definition at line 718 of file test_sax.py.

00718 
00719     def test_expat_incomplete(self):
00720         parser = create_parser()
00721         parser.setContentHandler(ContentHandler()) # do nothing
00722         self.assertRaises(SAXParseException, parser.parse, StringIO("<foo>"))

Here is the call graph for this function:

Definition at line 705 of file test_sax.py.

00705 
00706     def test_expat_inpsource_location(self):
00707         parser = create_parser()
00708         parser.setContentHandler(ContentHandler()) # do nothing
00709         source = InputSource()
00710         source.setByteStream(StringIO("<foo bar foobar>"))   #ill-formed
00711         name = "a file name"
00712         source.setSystemId(name)
00713         try:
00714             parser.parse(source)
00715             self.fail()
00716         except SAXException as e:
00717             self.assertEqual(e.getSystemId(), name)

Here is the call graph for this function:

Definition at line 723 of file test_sax.py.

00723 
00724     def test_sax_parse_exception_str(self):
00725         # pass various values from a locator to the SAXParseException to
00726         # make sure that the __str__() doesn't fall apart when None is
00727         # passed instead of an integer line and column number
00728         #
00729         # use "normal" values for the locator:
00730         str(SAXParseException("message", None,
00731                               self.DummyLocator(1, 1)))
00732         # use None for the line number:
00733         str(SAXParseException("message", None,
00734                               self.DummyLocator(None, 1)))
00735         # use None for the column number:
00736         str(SAXParseException("message", None,
00737                               self.DummyLocator(1, None)))
00738         # use None for both:
00739         str(SAXParseException("message", None,
00740                               self.DummyLocator(None, None)))


The documentation for this class was generated from the following file: