1. Christian Heimes
  2. defusedxml

Commits

Christian Heimes  committed f1a8a41

verify xmlrpc behavior

  • Participants
  • Parent commits 1e1eab4
  • Branches default

Comments (0)

Files changed (1)

File tests.py

View file
         self._data = []
 
     def __str__(self):
-        return "\n".join(self._data)
+        return "".join(self._data)
 
     def xml(self, encoding, standalone):
         pass
         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)
         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()