def setUp(self): super(ShareGroupAPITest, self).setUp() self.controller = share_groups.ShareGroupController() self.resource_name = self.controller.resource_name self.fake_share_type = {'id': six.text_type(uuidutils.generate_uuid())} self.fake_share_group_type = { 'id': six.text_type(uuidutils.generate_uuid())} self.api_version = '2.34' self.request = fakes.HTTPRequest.blank( '/share-groups', version=self.api_version, experimental=True) self.flags(rpc_backend='manila.openstack.common.rpc.impl_fake') self.admin_context = context.RequestContext('admin', 'fake', True) self.member_context = context.RequestContext('fake', 'fake') self.mock_policy_check = self.mock_object( policy, 'check_policy', mock.Mock(return_value=True)) self.context = self.request.environ['manila.context'] self.mock_object(share_group_types, 'get_default', mock.Mock(return_value=self.fake_share_group_type)) self.mock_object(share_types, 'get_default_share_type', mock.Mock(return_value=self.fake_share_type))
def setUp(self): super(ShareGroupAPITest, self).setUp() self.controller = share_groups.ShareGroupController() self.resource_name = self.controller.resource_name self.fake_share_type = {'id': uuidutils.generate_uuid()} self.fake_share_group_type = {'id': uuidutils.generate_uuid()} self.api_version = '2.34' self.request = fakes.HTTPRequest.blank('/share-groups', version=self.api_version, experimental=True) self.flags(transport_url='rabbit://*****:*****@mqhost:5672') self.admin_context = context.RequestContext('admin', 'fake', True) self.member_context = context.RequestContext('fake', 'fake') self.mock_policy_check = self.mock_object(policy, 'check_policy', mock.Mock(return_value=True)) self.context = self.request.environ['manila.context'] self.mock_object(share_group_types, 'get_default', mock.Mock(return_value=self.fake_share_group_type)) self.mock_object(share_types, 'get_default_share_type', mock.Mock(return_value=self.fake_share_type))