From: Jenkins Date: Fri, 14 Aug 2015 23:32:29 +0000 (+0000) Subject: Merge "On Volume list only retrieve needed data from DB" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=fb95d86da0a3f952261ce69039559829fe5269e3;p=openstack-build%2Fcinder-build.git Merge "On Volume list only retrieve needed data from DB" --- fb95d86da0a3f952261ce69039559829fe5269e3 diff --cc cinder/tests/unit/api/v2/stubs.py index 23504ac44,ef4184fdb..9e9192be8 --- a/cinder/tests/unit/api/v2/stubs.py +++ b/cinder/tests/unit/api/v2/stubs.py @@@ -158,9 -148,9 +158,9 @@@ def stub_volume_get_all(context, search def stub_volume_get_all_by_project(self, context, marker, limit, sort_keys=None, sort_dirs=None, filters=None, - viewable_admin_meta=False): + viewable_admin_meta=False, offset=None): filters = filters or {} - return [stub_volume_get(self, context, '1')] + return [stub_volume_get(self, context, '1', viewable_admin_meta=True)] def stub_snapshot(id, **kwargs): diff --cc cinder/tests/unit/api/v2/test_volumes.py index 1259dd167,69e1422a5..5b8ad4c11 --- a/cinder/tests/unit/api/v2/test_volumes.py +++ b/cinder/tests/unit/api/v2/test_volumes.py @@@ -61,10 -62,9 +63,11 @@@ class VolumeApiTest(test.TestCase) self.stubs.Set(db, 'service_get_all_by_topic', stubs.stub_service_get_all_by_topic) self.maxDiff = None + self.ctxt = context.RequestContext('admin', 'fakeproject', True) - def test_volume_create(self): + @mock.patch( + 'cinder.api.openstack.wsgi.Controller.validate_name_and_description') + def test_volume_create(self, mock_validate): self.stubs.Set(volume_api.API, 'get', stubs.stub_volume_get) self.stubs.Set(volume_api.API, "create", stubs.stub_volume_create)