def setUp(self): super(ShareAccessesAPITest, self).setUp() self.controller = (share_accesses.ShareAccessesController()) self.resource_name = self.controller.resource_name self.mock_policy_check = self.mock_object(policy, 'check_policy', mock.Mock(return_value=True)) self.share = db_utils.create_share() self.access = db_utils.create_share_access( id=uuidutils.generate_uuid(), share_id=self.share['id'], ) db_utils.create_share_access(id=uuidutils.generate_uuid(), share_id=self.share['id'], metadata={'k1': 'v1'})
def setUp(self): super(ShareAccessesMetadataAPITest, self).setUp() self.controller = ( share_access_metadata.ShareAccessMetadataController()) self.access_controller = (share_accesses.ShareAccessesController()) self.resource_name = self.controller.resource_name 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.share = db_utils.create_share() self.access = db_utils.create_share_access( id=uuidutils.generate_uuid(), share_id=self.share['id'])
def setUp(self): super(ShareAccessesMetadataAPITest, self).setUp() self.controller = ( share_access_metadata.ShareAccessMetadataController()) self.access_controller = ( share_accesses.ShareAccessesController()) self.resource_name = self.controller.resource_name 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.share = db_utils.create_share() self.access = db_utils.create_share_access( id=uuidutils.generate_uuid(), share_id=self.share['id'])