MCPcopy Index your code
hub / github.com/python/cpython / test_fail_no_info

Method test_fail_no_info

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected