Back to index

python3.2  3.2.2
Public Member Functions
test.test_pyexpat.sf1296433Test Class Reference

List of all members.

Public Member Functions

def test_parse_only_xml_data

Detailed Description

Definition at line 443 of file test_pyexpat.py.


Member Function Documentation

Definition at line 444 of file test_pyexpat.py.

00444 
00445     def test_parse_only_xml_data(self):
00446         # http://python.org/sf/1296433
00447         #
00448         xml = "<?xml version='1.0' encoding='iso8859'?><s>%s</s>" % ('a' * 1025)
00449         # this one doesn't crash
00450         #xml = "<?xml version='1.0'?><s>%s</s>" % ('a' * 10000)
00451 
00452         class SpecificException(Exception):
00453             pass
00454 
00455         def handler(text):
00456             raise SpecificException
00457 
00458         parser = expat.ParserCreate()
00459         parser.CharacterDataHandler = handler
00460 
00461         self.assertRaises(Exception, parser.Parse, xml)


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