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

Method test_server_encoding

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

Source from the content-addressed store, hash-verified

1010 http_server(evt, numrequests, requestHandler, 'iso-8859-15')
1011
1012 def test_server_encoding(self):
1013 start_string = '\u20ac'
1014 end_string = '\xa4'
1015
1016 try:
1017 p = xmlrpclib.ServerProxy(URL)
1018 self.assertEqual(p.add(start_string, end_string),
1019 start_string + end_string)
1020 except (xmlrpclib.ProtocolError, socket.error) as e:
1021 # ignore failures due to non-blocking socket unavailable errors.
1022 if not is_unavailable_exception(e):
1023 # protocol error; provide additional information in test output
1024 self.fail("%s\n%s" % (e, getattr(e, "headers", "")))
1025
1026
1027class MultiPathServerTestCase(BaseServerTestCase):

Callers

nothing calls this directly

Calls 4

is_unavailable_exceptionFunction · 0.85
assertEqualMethod · 0.45
addMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected