def setUp(self): super(NetworkCreateExceptionsTestV21, self).setUp() self._setup() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.new_network = copy.deepcopy(NEW_NETWORK) self.req = fakes.HTTPRequest.blank("")
def setUp(self): super(NetworkCreateExceptionsTestV21, self).setUp() self._setup() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.new_network = copy.deepcopy(NEW_NETWORK) self.req = fakes.HTTPRequest.blank('')
def setUp(self): super(NetworksAssociateTestV21, self).setUp() self.fake_network_api = FakeNetworkAPI() self._setup() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.req = fakes.HTTPRequest.blank('') self.admin_req = fakes.HTTPRequest.blank('', use_admin_context=True)
def setUp(self): super(VolumesSampleJsonTest, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(cinder.API, "delete", self._stub_volume_delete) self.stubs.Set(cinder.API, "get", self._stub_volume_get) self.stubs.Set(cinder.API, "get_all", self._stub_volume_get_all)
def setUp(self): super(VolumesSampleJsonTest, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(cinder.API, "delete", self._stub_volume_delete) self.stubs.Set(cinder.API, "get", self._stub_volume_get) self.stubs.Set(cinder.API, "get_all", self._stub_volume_get_all)
def setUp(self): super(NetworksAssociateTestV21, self).setUp() self.fake_network_api = FakeNetworkAPI() self._setup() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.req = fakes.HTTPRequest.blank("") self.admin_req = fakes.HTTPRequest.blank("", use_admin_context=True)
def setUp(self): super(NetworksTestV21, self).setUp() self.fake_network_api = FakeNetworkAPI() self._setup() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.new_network = copy.deepcopy(NEW_NETWORK) self.req = fakes.HTTPRequest.blank('') self.admin_req = fakes.HTTPRequest.blank('', use_admin_context=True)
def setUp(self): super(NetworksTestV21, self).setUp() self.fake_network_api = FakeNetworkAPI() self._setup() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.new_network = copy.deepcopy(NEW_NETWORK) self.req = fakes.HTTPRequest.blank("") self.admin_req = fakes.HTTPRequest.blank("", use_admin_context=True)
def setUp(self): super(FlavorsTestV21, self).setUp() self.flags(osapi_compute_extension=[]) fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(patron.compute.flavors, "get_all_flavors_sorted_list", fake_get_all_flavors_sorted_list) self.stubs.Set(patron.compute.flavors, "get_flavor_by_flavor_id", fake_flavor_get_by_flavor_id) self.controller = self.Controller()
def setUp(self): super(FixedIpTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(compute.api.API, "add_fixed_ip", compute_api_add_fixed_ip) self.stubs.Set(compute.api.API, "remove_fixed_ip", compute_api_remove_fixed_ip) self.stubs.Set(compute.api.API, 'get', compute_api_get) self.controller = self.controller_class.MultinicController() self.fake_req = fakes.HTTPRequest.blank('')
def setUp(self): super(FlavorsTestV21, self).setUp() self.flags(osapi_compute_extension=[]) fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(patron.compute.flavors, "get_all_flavors_sorted_list", fake_get_all_flavors_sorted_list) self.stubs.Set(patron.compute.flavors, "get_flavor_by_flavor_id", fake_flavor_get_by_flavor_id) self.controller = self.Controller()
def setUp(self): super(FixedIpTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(compute.api.API, "add_fixed_ip", compute_api_add_fixed_ip) self.stubs.Set(compute.api.API, "remove_fixed_ip", compute_api_remove_fixed_ip) self.stubs.Set(compute.api.API, 'get', compute_api_get) self.controller = self.controller_class.MultinicController() self.fake_req = fakes.HTTPRequest.blank('')
def setUp(self): super(SnapshotApiTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(cinder.API, "create_snapshot", fakes.stub_snapshot_create) self.stubs.Set(cinder.API, "create_snapshot_force", fakes.stub_snapshot_create) self.stubs.Set(cinder.API, "delete_snapshot", fakes.stub_snapshot_delete) self.stubs.Set(cinder.API, "get_snapshot", fakes.stub_snapshot_get) self.stubs.Set(cinder.API, "get_all_snapshots", fakes.stub_snapshot_get_all) self.stubs.Set(cinder.API, "get", fakes.stub_volume_get) self.req = fakes.HTTPRequest.blank('')
def setUp(self): super(SnapshotApiTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(cinder.API, "create_snapshot", fakes.stub_snapshot_create) self.stubs.Set(cinder.API, "create_snapshot_force", fakes.stub_snapshot_create) self.stubs.Set(cinder.API, "delete_snapshot", fakes.stub_snapshot_delete) self.stubs.Set(cinder.API, "get_snapshot", fakes.stub_snapshot_get) self.stubs.Set(cinder.API, "get_all_snapshots", fakes.stub_snapshot_get_all) self.stubs.Set(cinder.API, "get", fakes.stub_volume_get) self.req = fakes.HTTPRequest.blank('')
def setUp(self): super(VolumeApiTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(cinder.API, "delete", fakes.stub_volume_delete) self.stubs.Set(cinder.API, "get", fakes.stub_volume_get) self.stubs.Set(cinder.API, "get_all", fakes.stub_volume_get_all) self.flags(osapi_compute_extension=[ 'patron.api.openstack.compute.contrib.select_extensions' ], osapi_compute_ext_list=['Volumes']) self.context = context.get_admin_context() self.app = self._get_app()
def setUp(self): super(VolumeApiTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(cinder.API, "delete", fakes.stub_volume_delete) self.stubs.Set(cinder.API, "get", fakes.stub_volume_get) self.stubs.Set(cinder.API, "get_all", fakes.stub_volume_get_all) self.flags( osapi_compute_extension=[ 'patron.api.openstack.compute.contrib.select_extensions'], osapi_compute_ext_list=['Volumes']) self.context = context.get_admin_context() self.app = self._get_app()
def setUp(self): super(KeypairsTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(db, "key_pair_get_all_by_user", db_key_pair_get_all_by_user) self.stubs.Set(db, "key_pair_create", db_key_pair_create) self.stubs.Set(db, "key_pair_destroy", db_key_pair_destroy) self.flags(osapi_compute_extension=[ 'patron.api.openstack.compute.contrib.select_extensions' ], osapi_compute_ext_list=['Keypairs']) self._setup_app_and_controller() self.req = fakes.HTTPRequest.blank('', version=self.wsgi_api_version)
def setUp(self): super(KeypairsTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) self.stubs.Set(db, "key_pair_get_all_by_user", db_key_pair_get_all_by_user) self.stubs.Set(db, "key_pair_create", db_key_pair_create) self.stubs.Set(db, "key_pair_destroy", db_key_pair_destroy) self.flags( osapi_compute_extension=[ 'patron.api.openstack.compute.contrib.select_extensions'], osapi_compute_ext_list=['Keypairs']) self._setup_app_and_controller() self.req = fakes.HTTPRequest.blank('', version=self.wsgi_api_version)
def setUp(self): super(ConfigDriveSampleJsonTest, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) fake.stub_out_image_service(self.stubs)
def setUp(self): """Run before each test.""" super(ImagesControllerTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) fakes.stub_out_key_pair_funcs(self.stubs) fakes.stub_out_compute_api_snapshot(self.stubs) fakes.stub_out_compute_api_backup(self.stubs) self.controller = self.image_controller_class() self.url_prefix = "http://localhost%s/images" % self.url_base self.bookmark_prefix = "http://localhost%s/images" % self.bookmark_base self.uuid = 'fa95aaf5-ab3b-4cd8-88c0-2be7dd051aaf' self.server_uuid = "aa640691-d1a7-4a67-9d3c-d35ee6b3cc74" self.server_href = ( "http://localhost%s/servers/%s" % (self.url_base, self.server_uuid)) self.server_bookmark = ( "http://localhost%s/servers/%s" % (self.bookmark_base, self.server_uuid)) self.alternate = "%s/images/%s" self.expected_image_123 = { "image": {'id': '123', 'name': 'public image', 'metadata': {'key1': 'value1'}, 'updated': NOW_API_FORMAT, 'created': NOW_API_FORMAT, 'status': 'ACTIVE', 'minDisk': 10, 'progress': 100, 'minRam': 128, "links": [{ "rel": "self", "href": "%s/123" % self.url_prefix }, { "rel": "bookmark", "href": "%s/123" % self.bookmark_prefix }, { "rel": "alternate", "type": "application/vnd.openstack.image", "href": self.alternate % (glance.generate_glance_url(), 123), }], }, } self.expected_image_124 = { "image": {'id': '124', 'name': 'queued snapshot', 'metadata': { u'instance_uuid': self.server_uuid, u'user_id': u'fake', }, 'updated': NOW_API_FORMAT, 'created': NOW_API_FORMAT, 'status': 'SAVING', 'progress': 25, 'minDisk': 0, 'minRam': 0, 'server': { 'id': self.server_uuid, "links": [{ "rel": "self", "href": self.server_href, }, { "rel": "bookmark", "href": self.server_bookmark, }], }, "links": [{ "rel": "self", "href": "%s/124" % self.url_prefix }, { "rel": "bookmark", "href": "%s/124" % self.bookmark_prefix }, { "rel": "alternate", "type": "application/vnd.openstack.image", "href": self.alternate % (glance.generate_glance_url(), 124), }], }, }
def setUp(self): super(ConfigDriveTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) fake.stub_out_image_service(self.stubs) self._setup_wsgi()
def setUp(self): """Run before each test.""" super(ImagesControllerTestV21, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) fakes.stub_out_key_pair_funcs(self.stubs) fakes.stub_out_compute_api_snapshot(self.stubs) fakes.stub_out_compute_api_backup(self.stubs) self.controller = self.image_controller_class() self.url_prefix = "http://localhost%s/images" % self.url_base self.bookmark_prefix = "http://localhost%s/images" % self.bookmark_base self.uuid = 'fa95aaf5-ab3b-4cd8-88c0-2be7dd051aaf' self.server_uuid = "aa640691-d1a7-4a67-9d3c-d35ee6b3cc74" self.server_href = ("http://localhost%s/servers/%s" % (self.url_base, self.server_uuid)) self.server_bookmark = ("http://localhost%s/servers/%s" % (self.bookmark_base, self.server_uuid)) self.alternate = "%s/images/%s" self.expected_image_123 = { "image": { 'id': '123', 'name': 'public image', 'metadata': { 'key1': 'value1' }, 'updated': NOW_API_FORMAT, 'created': NOW_API_FORMAT, 'status': 'ACTIVE', 'minDisk': 10, 'progress': 100, 'minRam': 128, "links": [{ "rel": "self", "href": "%s/123" % self.url_prefix }, { "rel": "bookmark", "href": "%s/123" % self.bookmark_prefix }, { "rel": "alternate", "type": "application/vnd.openstack.image", "href": self.alternate % (glance.generate_glance_url(), 123), }], }, } self.expected_image_124 = { "image": { 'id': '124', 'name': 'queued snapshot', 'metadata': { u'instance_uuid': self.server_uuid, u'user_id': u'fake', }, 'updated': NOW_API_FORMAT, 'created': NOW_API_FORMAT, 'status': 'SAVING', 'progress': 25, 'minDisk': 0, 'minRam': 0, 'server': { 'id': self.server_uuid, "links": [{ "rel": "self", "href": self.server_href, }, { "rel": "bookmark", "href": self.server_bookmark, }], }, "links": [{ "rel": "self", "href": "%s/124" % self.url_prefix }, { "rel": "bookmark", "href": "%s/124" % self.bookmark_prefix }, { "rel": "alternate", "type": "application/vnd.openstack.image", "href": self.alternate % (glance.generate_glance_url(), 124), }], }, }
def setUp(self): super(TestNoAuthMiddlewareV3, self).setUp() fakes.stub_out_rate_limiting(self.stubs) fakes.stub_out_networking(self.stubs)
def setUp(self): super(ConfigDriveSampleJsonTest, self).setUp() fakes.stub_out_networking(self.stubs) fakes.stub_out_rate_limiting(self.stubs) fake.stub_out_image_service(self.stubs)
def setUp(self): super(TestNoAuthMiddleware, self).setUp() fakes.stub_out_rate_limiting(self.stubs) fakes.stub_out_networking(self.stubs)