def setUp(self): self.httpd = BaseHTTPServer.HTTPServer(('', 0), TestServiceHandler) self.port = self.httpd.socket.getsockname()[1] thread = threading.Thread(target=self.httpd.serve_forever) thread.daemon = True thread.start() self.client = ProtobufRestServiceClient( 'http://localhost:%d' % self.port, queueschema)
def __init__(self, uri, queueSchema): self.client = ProtobufRestServiceClient( uri.rstrip('/') + self._base_uri, queueSchema, connection_error_class=ZepConnectionError)