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

Method test_multicall

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

Source from the content-addressed store, hash-verified

919 self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
920
921 def test_multicall(self):
922 try:
923 p = xmlrpclib.ServerProxy(URL)
924 multicall = xmlrpclib.MultiCall(p)
925 multicall.add(2,3)
926 multicall.pow(6,8)
927 multicall.div(127,42)
928 add_result, pow_result, div_result = multicall()
929 self.assertEqual(add_result, 2+3)
930 self.assertEqual(pow_result, 6**8)
931 self.assertEqual(div_result, 127//42)
932 except (xmlrpclib.ProtocolError, OSError) as e:
933 # ignore failures due to non-blocking socket 'unavailable' errors
934 if not is_unavailable_exception(e):
935 # protocol error; provide additional information in test output
936 self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
937
938 def test_non_existing_multicall(self):
939 try:

Callers

nothing calls this directly

Calls 5

is_unavailable_exceptionFunction · 0.85
divMethod · 0.80
addMethod · 0.45
assertEqualMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected