summaryrefslogtreecommitdiff
path: root/tests.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2013-03-26 10:28:01 +0100
committerChristian Heimes <christian@python.org>2013-03-26 10:28:01 +0100
commite841a4e43e318218ed52d1664984a666f91c0951 (patch)
treed8de4ca774fe8b2865bb42bde2e7fb277a77d3a9 /tests.py
parent873c88ce1187c7a46f0398baf26b9a6519d1162b (diff)
downloaddefusedxml-git-e841a4e43e318218ed52d1664984a666f91c0951.tar.gz
verify xmlrpc behavior
Diffstat (limited to 'tests.py')
-rw-r--r--tests.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests.py b/tests.py
index 78927ac..7c63ea2 100644
--- a/tests.py
+++ b/tests.py
@@ -420,7 +420,7 @@ class XmlRpcTarget(object):
self._data = []
def __str__(self):
- return "\n".join(self._data)
+ return "".join(self._data)
def xml(self, encoding, standalone):
pass
@@ -444,6 +444,14 @@ class TestXmlRpc(DefusedTestCase):
parser.close()
return target
+ def parse_unpatched(self, xmlfile):
+ target = XmlRpcTarget()
+ parser = self.module.ExpatParser(target)
+ data = self.get_content(xmlfile)
+ parser.feed(data)
+ parser.close()
+ return target
+
def test_xmlrpc(self):
self.assertRaises(EntitiesForbidden, self.parse, self.xml_bomb)
self.assertRaises(EntitiesForbidden, self.parse, self.xml_quadratic)
@@ -451,6 +459,10 @@ class TestXmlRpc(DefusedTestCase):
self.assertRaises(DTDForbidden, self.parse, self.xml_dtd,
forbid_dtd=True)
+ #def test_xmlrpc_unpatched(self):
+ # for fname in (self.xml_external, self.xml_dtd):
+ # print(self.parse_unpatched(fname))
+
def test_monkeypatch(self):
try:
xmlrpc.monkey_patch()