MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_expat_external_dtd_enabled

Method test_expat_external_dtd_enabled

Lib/test/test_sax.py:1004–1019  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1002
1003 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'
1004 def test_expat_external_dtd_enabled(self):
1005 # clear _opener global variable
1006 self.addCleanup(urllib.request.urlcleanup)
1007
1008 parser = create_parser()
1009 parser.setFeature(feature_external_ges, True)
1010 resolver = self.TestEntityRecorder()
1011 parser.setEntityResolver(resolver)
1012
1013 with self.assertRaises(URLError):
1014 parser.feed(
1015 '<!DOCTYPE external SYSTEM "unsupported://non-existing">\n'
1016 )
1017 self.assertEqual(
1018 resolver.entities, [(None, 'unsupported://non-existing')]
1019 )
1020
1021 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'xmlparser' object has no attribute 'SetParamEntityParsing'
1022 def test_expat_external_dtd_default(self):

Callers

nothing calls this directly

Calls 7

create_parserFunction · 0.90
addCleanupMethod · 0.80
setEntityResolverMethod · 0.80
setFeatureMethod · 0.45
assertRaisesMethod · 0.45
feedMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected