예제 #1
0
    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)
예제 #2
0
 def __init__(self, uri, queueSchema):
     self.client = ProtobufRestServiceClient(
         uri.rstrip('/') + self._base_uri,
         queueSchema,
         connection_error_class=ZepConnectionError)