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

Method test_fail_no_info

Lib/test/test_xmlrpc.py:1387–1401  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1385 self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
1386
1387 def test_fail_no_info(self):
1388 # use the broken message class
1389 xmlrpc.server.SimpleXMLRPCRequestHandler.MessageClass = FailingMessageClass
1390
1391 try:
1392 p = xmlrpclib.ServerProxy(URL)
1393 p.pow(6,8)
1394 except (xmlrpclib.ProtocolError, OSError) as e:
1395 # ignore failures due to non-blocking socket 'unavailable' errors
1396 if not is_unavailable_exception(e) and hasattr(e, "headers"):
1397 # The two server-side error headers shouldn't be sent back in this case
1398 self.assertTrue(e.headers.get("X-exception") is None)
1399 self.assertTrue(e.headers.get("X-traceback") is None)
1400 else:
1401 self.fail('ProtocolError not raised')
1402
1403 def test_fail_with_info(self):
1404 # use the broken message class

Callers

nothing calls this directly

Calls 5

is_unavailable_exceptionFunction · 0.85
hasattrFunction · 0.85
assertTrueMethod · 0.80
getMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected