Esempio n. 1
0
 def setUp(self):
     super(ShareReplicasApiTest, self).setUp()
     self.controller = share_replicas.ShareReplicationController()
     self.resource_name = self.controller.resource_name
     self.api_version = share_replicas.MIN_SUPPORTED_API_VERSION
     self.replicas_req = fakes.HTTPRequest.blank('/share-replicas',
                                                 version=self.api_version,
                                                 experimental=True)
     self.member_context = context.RequestContext('fake', 'fake')
     self.replicas_req.environ['manila.context'] = self.member_context
     self.replicas_req_admin = fakes.HTTPRequest.blank(
         '/share-replicas',
         version=self.api_version,
         experimental=True,
         use_admin_context=True)
     self.admin_context = self.replicas_req_admin.environ['manila.context']
     self.mock_policy_check = self.mock_object(policy, 'check_policy')
     self.fake_share_network = {
         'id': 'fake network id',
         'project_id': 'fake project',
         'updated_at': None,
         'name': 'fake name',
         'description': 'fake description',
         'security_services': [],
         'share_network_subnets': [],
         'security_service_update_support': True,
         'status': 'active'
     }
Esempio n. 2
0
 def setUp(self):
     super(ShareReplicasApiTest, self).setUp()
     self.controller = share_replicas.ShareReplicationController()
     self.resource_name = self.controller.resource_name
     self.api_version = share_replicas.MIN_SUPPORTED_API_VERSION
     self.replicas_req = fakes.HTTPRequest.blank('/share-replicas',
                                                 version=self.api_version,
                                                 experimental=True)
     self.context = context.RequestContext('user', 'fake', False)
     self.replicas_req.environ['manila.context'] = self.context
     self.admin_context = context.RequestContext('admin', 'fake', True)
     self.mock_policy_check = self.mock_object(policy, 'check_policy')