예제 #1
0
 def setUp(self):
     self.client = Client(LibcloudRestApp(), BaseResponse)
     self.fixtures = ComputeFixtures('rackspace')
     self.headers = {'x-auth-user': '******', 'x-api-key': 'key'}
     self.url_tmpl = rest_versions[libcloud.__version__] +\
         '/compute/RACKSPACE/%s?test=1'
     OpenStackMockHttp.type = None
예제 #2
0
 def setUp(self):
     self.url_tmpl = rest_versions[libcloud.__version__] +\
         '/loadbalancer/RACKSPACE_US/%s?test=1'
     self.client = Client(LibcloudRestApp(), BaseResponse)
     self.fixtures = DNSFixtures('rackspace_us')
     self.headers = {'x-auth-user': '******', 'x-api-key': 'key'}
     RackspaceLBMockHttp.type = None
예제 #3
0
 def setUp(self):
     self.url_tmpl = rest_versions[libcloud.__version__] +\
         '/dns/ZERIGO/%s?test=1'
     self.client = Client(LibcloudRestApp(), BaseResponse)
     self.fixtures = DNSFixtures('zerigo')
     self.headers = {'x-auth-user': '******', 'x-api-key': 'api token'}
     ZerigoMockHttp.type = None
예제 #4
0
 def setUp(self):
     self.url_tmpl = rest_versions[libcloud.__version__] +\
         '/storage/CLOUDFILES_US/%s?test=1'
     self.client = Client(LibcloudRestApp(), BaseResponse)
     self.headers = {'x-auth-user': '******', 'x-api-key': 'key'}
     CloudFilesMockHttp.type = None
     CloudFilesMockRawResponse.type = None
예제 #5
0
def start_server(host, port, logger, debug):
    from werkzeug.serving import run_simple
    from libcloud_rest.application import LibcloudRestApp
    import werkzeug

    app = LibcloudRestApp()

    if debug:
        logger.info('Debug HTTP server listening on %s:%s' % (host, port))
        run_simple(host, port, app,
                   use_debugger=True, use_reloader=True)
    else:
        from gevent.monkey import patch_all
        from gevent import pywsgi as wsgi

        patch_all()
        logger.info('HTTP server listening on %s:%s' % (host, port))

        @werkzeug.serving.run_with_reloader
        def run_server():
            class debug_logger(object):
                @staticmethod
                def write(*args, **kwargs):
                    logger.debug(*args, **kwargs)

            ws = wsgi.WSGIServer((host, port), app, log=debug_logger)
            ws.serve_forever()
예제 #6
0
 def setUp(self):
     self.url_tmpl = rest_versions[libcloud.__version__] +\
         '/dns/LINODE/%s?test=1'
     self.client = Client(LibcloudRestApp(), BaseResponse)
     self.fixtures = DNSFixtures('linode')
     self.headers = {'x-auth-user': '******', 'x-api-key': 'key'}
     LinodeMockHttp.use_param = 'api_action'
     LinodeMockHttp.type = None
예제 #7
0
def start_server(host, port, logger, debug):
    from werkzeug.serving import run_simple
    from libcloud_rest.application import LibcloudRestApp

    app = LibcloudRestApp()

    logger.info('Debug HTTP server listening on %s:%s' % (host, port))
    run_simple(host, port, app,
               use_debugger=True, use_reloader=True)
예제 #8
0
 def setUp(self):
     self.url_tmpl = rest_versions[libcloud.__version__] +\
                     '/compute/cloudstack/%s?test=1'
     self.client = Client(LibcloudRestApp(), BaseResponse)
     self.fixtures = ComputeFixtures('cloudstack')
예제 #9
0
 def setUp(self):
     self.client = Client(LibcloudRestApp(), BaseResponse)
     self.fixtures = ComputeFixtures('gogrid')
     self.headers = {'x-auth-user': '******', 'x-api-key': 'b'}
     self.url_tmpl = rest_versions[libcloud.__version__] +\
         '/compute/gogrid/%s?test=1'
예제 #10
0
def cli_start_server():
    from werkzeug.serving import run_simple

    app = LibcloudRestApp()
    run_simple('127.0.0.1', 5000, app, use_debugger=True, use_reloader=True)
예제 #11
0
 def setUp(self):
     self.client = Client(LibcloudRestApp(), BaseResponse)
     self.fixtures = ComputeFixtures()
예제 #12
0
 def setUp(self):
     self.client = Client(LibcloudRestApp(), BaseResponse)
     self.fixtures = LoadBalancerFixtures()