def setUp(self): super(TestInsertQueue, self).setUp() self.base_url = '{0}/{1}'.format(self.cfg.marconi.url, "v1") self.header = helpers.create_marconi_headers(self.cfg) self.headers_response_empty = set(['location']) self.client.set_base_url(self.base_url) self.header = helpers.create_marconi_headers(self.cfg)
def setUp(self): super(TestInsertQueue, self).setUp() self.base_url = "{0}/{1}".format(self.cfg.marconi.url, self.cfg.marconi.version) self.header = helpers.create_marconi_headers(self.cfg) self.headers_response_empty = set(["location"]) self.client.set_base_url(self.base_url) self.header = helpers.create_marconi_headers(self.cfg)
def setUp(self): super(TestQueueNonExisting, self).setUp() self.base_url = "{0}/{1}".format(self.cfg.marconi.url, self.cfg.marconi.version) self.queue_url = self.base_url + "/queues/0a5b1b85-4263-11e3-b034-28cfe91478b9" self.client.set_base_url(self.queue_url) self.header = helpers.create_marconi_headers(self.cfg) self.headers_response_empty = set(["location"]) self.header = helpers.create_marconi_headers(self.cfg)
def setUp(self): super(TestQueueNonExisting, self).setUp() self.base_url = '{0}/{1}'.format(self.cfg.marconi.url, "v1") self.queue_url = (self.base_url + '/queues/0a5b1b85-4263-11e3-b034-28cfe91478b9') self.client.set_base_url(self.queue_url) self.header = helpers.create_marconi_headers(self.cfg) self.headers_response_empty = set(['location']) self.header = helpers.create_marconi_headers(self.cfg)
def setUp(self): super(TestQueueNonExisting, self).setUp() self.base_url = '{0}/{1}'.format(self.cfg.marconi.url, self.cfg.marconi.version) self.queue_url = self.base_url + \ '/queues/0a5b1b85-4263-11e3-b034-28cfe91478b9' self.client.set_base_url(self.queue_url) self.header = helpers.create_marconi_headers(self.cfg) self.headers_response_empty = set(['location']) self.header = helpers.create_marconi_headers(self.cfg)
def setUp(self): super(FunctionalTestBase, self).setUp() # NOTE(flaper87): Config can't be a class # attribute because it may be necessary to # modify it at runtime which will affect # other instances running instances. self.cfg = config.load_config() if not self.cfg.run_tests: self.skipTest("Functional tests disabled") self.mconf = self.load_conf(self.cfg.marconi.config) # NOTE(flaper87): Use running instances. if (self.cfg.marconi.run_server and not self.server): self.server = self.server_class() self.server.start(self.mconf) validator = validation.Validator(self.mconf) self.limits = validator._limits_conf # NOTE(flaper87): Create client # for this test unit. self.client = http.Client() self.headers = helpers.create_marconi_headers(self.cfg) if self.cfg.auth.auth_on: auth_token = helpers.get_keystone_token(self.cfg, self.client) self.headers["X-Auth-Token"] = auth_token self.headers_response_with_body = set(['location', 'content-type']) self.client.set_headers(self.headers)
def setUpClass(cls): cls.cfg = config.load_config() cls.mconf = cls.load_conf(cls.cfg.marconi.config).conf cls.limits = cls.mconf['limits:transport'] cls.header = helpers.create_marconi_headers(cls.cfg) cls.headers_response_with_body = set(['location', 'content-type'])
def setUp(self): super(FunctionalTestBase, self).setUp() # NOTE(flaper87): Config can't be a class # attribute because it may be necessary to # modify it at runtime which will affect # other instances running instances. self.cfg = config.load_config() if not self.cfg.run_tests: self.skipTest("Functional tests disabled") # NOTE(flaper87): Use running instances. if (self.cfg.marconi.run_server and not self.server): self.server = self.server_class() self.server.start(self.conf_path(self.cfg.marconi.config)) self.mconf = self.load_conf(self.cfg.marconi.config).conf self.limits = self.mconf['limits:transport'] # NOTE(flaper87): Create client # for this test unit. self.client = http.Client() self.header = helpers.create_marconi_headers(self.cfg) if self.cfg.auth.auth_on: auth_token = helpers.get_keystone_token(self.cfg, self.client) self.header["X-Auth-Token"] = auth_token self.headers_response_with_body = set(['location', 'content-type']) self.client.set_headers(self.header)
def test_get_messages_invalid_client_id(self, client_id): """Get messages with invalid client id.""" url = self.message_url header = helpers.create_marconi_headers(self.cfg) header['Client-ID'] = client_id result = self.client.get(url, headers=header) self.assertEqual(result.status_code, 400)
def setUp(self): super(TestMessages, self).setUp() self.queue = uuid.uuid1() # Generate a random queue ID self.queue_url = ("{url}/{version}/queues/{queue}".format( url=self.cfg.marconi.url, version="v1.1", queue=self.queue)) self.headers = helpers.create_marconi_headers(self.cfg) self.client.headers = self.headers self.client.put(self.queue_url) # Create the queue self.message_url = self.queue_url + '/messages' self.client.set_base_url(self.message_url)
def setUp(self): super(TestShards, self).setUp() self.shard_url = ("{url}/{version}/shards".format( url=self.cfg.marconi.url, version="v1.1" )) self.cfg.marconi.version = "v1.1" self.skipTest("NOT IMPLEMENTED") self.headers = helpers.create_marconi_headers(self.cfg) self.client.headers = self.headers self.client.set_base_url(self.shard_url)
def setUp(self): super(FunctionalTestBase, self).setUp() # NOTE(flaper87): Config can't be a class # attribute because it may be necessary to # modify it at runtime which will affect # other instances running instances. self.cfg = config.load_config() if not self.cfg.run_tests: self.skipTest("Functional tests disabled") self.mconf = self.load_conf(self.cfg.marconi.config) validator = validation.Validator(self.mconf) self.limits = validator._limits_conf self.response = response.ResponseSchema(self.limits) if _TEST_INTEGRATION: # TODO(kgriffs): This code should be replaced to use # an external wsgi server instance. # NOTE(flaper87): Use running instances. if self.cfg.marconi.run_server: if not (self.server and self.server.is_alive()): # pylint: disable=not-callable self.server = self.server_class() self.server.start(self.mconf) self.client = http.Client() else: self.client = http.WSGIClient( bootstrap.Bootstrap(config.cfg.CONF).transport.app) self.headers = helpers.create_marconi_headers(self.cfg) if self.cfg.auth.auth_on: auth_token = helpers.get_keystone_token(self.cfg, self.client) self.headers["X-Auth-Token"] = auth_token self.headers_response_with_body = set(['location', 'content-type']) self.client.set_headers(self.headers)
def setUp(self): super(TestClaims, self).setUp() self.headers = helpers.create_marconi_headers(self.cfg) self.client.headers = self.headers self.queue = uuid.uuid1() self.queue_url = ("{url}/{version}/queues/{queue}".format( url=self.cfg.marconi.url, version="v1.1", queue=self.queue)) self.client.put(self.queue_url) self.claim_url = self.queue_url + '/claims' self.client.set_base_url(self.claim_url) # Post Messages url = self.queue_url + '/messages' doc = helpers.create_message_body( messagecount=self.limits.max_messages_per_page) for i in range(10): self.client.post(url, data=doc)