summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-04 08:26:42 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-04 08:26:42 (GMT)
commit290fed43d9cdcd3d738dda319e63e26d7972d734 (patch)
tree3b93719d90b2c19df4f69c9ca2049036e3e3271f /Lib/test
parenta3fd0b26ba7d302475e051b698c86f512d0e7a14 (diff)
downloadcpython-290fed43d9cdcd3d738dda319e63e26d7972d734.zip
cpython-290fed43d9cdcd3d738dda319e63e26d7972d734.tar.gz
cpython-290fed43d9cdcd3d738dda319e63e26d7972d734.tar.bz2
Issue #26873: xmlrpc now raises ResponseError on unsupported type tags
instead of silently return incorrect result.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_xmlrpc.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index 831a5a5..02d9f5c 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -224,6 +224,20 @@ class XMLRPCTestCase(unittest.TestCase):
self.assertIs(type(newvalue), xmlrpclib.Binary)
self.assertIsNone(m)
+ def test_loads_unsupported(self):
+ ResponseError = xmlrpclib.ResponseError
+ data = '<params><param><value><spam/></value></param></params>'
+ self.assertRaises(ResponseError, xmlrpclib.loads, data)
+ data = ('<params><param><value><array>'
+ '<value><spam/></value>'
+ '</array></value></param></params>')
+ self.assertRaises(ResponseError, xmlrpclib.loads, data)
+ data = ('<params><param><value><struct>'
+ '<member><name>a</name><value><spam/></value></member>'
+ '<member><name>b</name><value><spam/></value></member>'
+ '</struct></value></param></params>')
+ self.assertRaises(ResponseError, xmlrpclib.loads, data)
+
def test_get_host_info(self):
# see bug #3613, this raised a TypeError
transp = xmlrpc.client.Transport()