| OLD | NEW |
| 1 # XXX TypeErrors on calling handlers, or on bad return values from a | 1 # XXX TypeErrors on calling handlers, or on bad return values from a |
| 2 # handler, are obscure and unhelpful. | 2 # handler, are obscure and unhelpful. |
| 3 | 3 |
| 4 from io import BytesIO | 4 from io import BytesIO |
| 5 import sys | 5 import sys |
| 6 import unittest | 6 import unittest |
| 7 | 7 |
| 8 import pyexpat | 8 import pyexpat |
| 9 from xml.parsers import expat | 9 from xml.parsers import expat |
| 10 | 10 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 'DefaultHandler', 'DefaultHandlerExpand', | 124 'DefaultHandler', 'DefaultHandlerExpand', |
| 125 #'NotStandaloneHandler', | 125 #'NotStandaloneHandler', |
| 126 'ExternalEntityRefHandler' | 126 'ExternalEntityRefHandler' |
| 127 ] | 127 ] |
| 128 | 128 |
| 129 def _verify_parse_output(self, op): | 129 def _verify_parse_output(self, op): |
| 130 self.assertEquals(op[0], 'PI: \'xml-stylesheet\' \'href="stylesheet.css"
\'') | 130 self.assertEquals(op[0], 'PI: \'xml-stylesheet\' \'href="stylesheet.css"
\'') |
| 131 self.assertEquals(op[1], "Comment: ' comment data '") | 131 self.assertEquals(op[1], "Comment: ' comment data '") |
| 132 self.assertEquals(op[2], "Notation declared: ('notation', None, 'notatio
n.jpeg', None)") | 132 self.assertEquals(op[2], "Notation declared: ('notation', None, 'notatio
n.jpeg', None)") |
| 133 self.assertEquals(op[3], "Unparsed entity decl: ('unparsed_entity', None
, 'entity.file', None, 'notation')") | 133 self.assertEquals(op[3], "Unparsed entity decl: ('unparsed_entity', None
, 'entity.file', None, 'notation')") |
| 134 self.assertEquals(op[4], "Start element: 'root' {'attr1': 'value1', 'att
r2': 'value2\\u1f40'}") | 134 self.assertEquals(op[4], "Start element: 'root' {'attr1': 'value1', 'att
r2': 'value2\u1f40'}") |
| 135 self.assertEquals(op[5], "NS decl: 'myns' 'http://www.python.org/namespa
ce'") | 135 self.assertEquals(op[5], "NS decl: 'myns' 'http://www.python.org/namespa
ce'") |
| 136 self.assertEquals(op[6], "Start element: 'http://www.python.org/namespac
e!subelement' {}") | 136 self.assertEquals(op[6], "Start element: 'http://www.python.org/namespac
e!subelement' {}") |
| 137 self.assertEquals(op[7], "Character data: 'Contents of subelements'") | 137 self.assertEquals(op[7], "Character data: 'Contents of subelements'") |
| 138 self.assertEquals(op[8], "End element: 'http://www.python.org/namespace!
subelement'") | 138 self.assertEquals(op[8], "End element: 'http://www.python.org/namespace!
subelement'") |
| 139 self.assertEquals(op[9], "End of NS decl: 'myns'") | 139 self.assertEquals(op[9], "End of NS decl: 'myns'") |
| 140 self.assertEquals(op[10], "Start element: 'sub2' {}") | 140 self.assertEquals(op[10], "Start element: 'sub2' {}") |
| 141 self.assertEquals(op[11], 'Start of CDATA section') | 141 self.assertEquals(op[11], 'Start of CDATA section') |
| 142 self.assertEquals(op[12], "Character data: 'contents of CDATA section'") | 142 self.assertEquals(op[12], "Character data: 'contents of CDATA section'") |
| 143 self.assertEquals(op[13], 'End of CDATA section') | 143 self.assertEquals(op[13], 'End of CDATA section') |
| 144 self.assertEquals(op[14], "End element: 'sub2'") | 144 self.assertEquals(op[14], "End element: 'sub2'") |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 NamespaceSeparatorTest, | 517 NamespaceSeparatorTest, |
| 518 InterningTest, | 518 InterningTest, |
| 519 BufferTextTest, | 519 BufferTextTest, |
| 520 HandlerExceptionTest, | 520 HandlerExceptionTest, |
| 521 PositionTest, | 521 PositionTest, |
| 522 sf1296433Test, | 522 sf1296433Test, |
| 523 ChardataBufferTest) | 523 ChardataBufferTest) |
| 524 | 524 |
| 525 if __name__ == "__main__": | 525 if __name__ == "__main__": |
| 526 test_main() | 526 test_main() |
| OLD | NEW |