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
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
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
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
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()
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
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)
def setUp(self): self.url_tmpl = rest_versions[libcloud.__version__] +\ '/compute/cloudstack/%s?test=1' self.client = Client(LibcloudRestApp(), BaseResponse) self.fixtures = ComputeFixtures('cloudstack')
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'
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)
def setUp(self): self.client = Client(LibcloudRestApp(), BaseResponse) self.fixtures = ComputeFixtures()
def setUp(self): self.client = Client(LibcloudRestApp(), BaseResponse) self.fixtures = LoadBalancerFixtures()