summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-24 11:17:08 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-24 11:17:08 (GMT)
commite26d3af7ee5b8ce804786d31ecfda173d92d7ab0 (patch)
treeb249f6950422d62999443fdb56d499f8b7e27f1d /Lib/test
parent6f80f5d4446f06d15274ad519cae6929a3565cc0 (diff)
downloadcpython-e26d3af7ee5b8ce804786d31ecfda173d92d7ab0.zip
cpython-e26d3af7ee5b8ce804786d31ecfda173d92d7ab0.tar.gz
cpython-e26d3af7ee5b8ce804786d31ecfda173d92d7ab0.tar.bz2
Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD()
method doesn't require an argument again.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_pyexpat.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
index 27eecb8..117bda0 100644
--- a/Lib/test/test_pyexpat.py
+++ b/Lib/test/test_pyexpat.py
@@ -641,6 +641,16 @@ class ForeignDTDTests(unittest.TestCase):
parser.Parse("<?xml version='1.0'?><element/>")
self.assertEqual(handler_call_args, [(None, None)])
+ # test UseForeignDTD() is equal to UseForeignDTD(True)
+ handler_call_args[:] = []
+
+ parser = expat.ParserCreate()
+ parser.UseForeignDTD()
+ parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS)
+ parser.ExternalEntityRefHandler = resolve_entity
+ parser.Parse("<?xml version='1.0'?><element/>")
+ self.assertEqual(handler_call_args, [(None, None)])
+
def test_ignore_use_foreign_dtd(self):
"""
If UseForeignDTD is passed True and a document with an external