MCPcopy Index your code
hub / github.com/python/cpython / test_bug_xmltoolkit62

Method test_bug_xmltoolkit62

Lib/test/test_xml_etree.py:2332–2347  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2330 self.assertRaises(OSError, ET.parse, ExceptionFile())
2331
2332 def test_bug_xmltoolkit62(self):
2333 # Don't crash when using custom entities.
2334
2335 ENTITIES = {'rsquo': '\u2019', 'lsquo': '\u2018'}
2336 parser = ET.XMLParser()
2337 parser.entity.update(ENTITIES)
2338 parser.feed("""<?xml version="1.0" encoding="UTF-8"?>
2339<!DOCTYPE patent-application-publication SYSTEM "pap-v15-2001-01-31.dtd" []>
2340<patent-application-publication>
2341<subdoc-abstract>
2342<paragraph id="A-0001" lvl="0">A new cultivar of Begonia plant named &lsquo;BCT9801BEG&rsquo;.</paragraph>
2343</subdoc-abstract>
2344</patent-application-publication>""")
2345 t = parser.close()
2346 self.assertEqual(t.find('.//paragraph').text,
2347 'A new cultivar of Begonia plant named \u2018BCT9801BEG\u2019.')
2348
2349 @unittest.skipIf(sys.gettrace(), "Skips under coverage.")
2350 def test_bug_xmltoolkit63(self):

Callers

nothing calls this directly

Calls 5

feedMethod · 0.95
closeMethod · 0.95
updateMethod · 0.45
assertEqualMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected