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

Method test_multicall

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected