def setUp(self): super(ApiInitTestCase, self).setUp() self.controller = self.mock( 'ec2api.api.cloud.VpcCloudController').return_value self.fake_context = mock.NonCallableMock( request_id=context.generate_request_id()) ec2_request = apirequest.APIRequest('FakeAction', 'fake_v1', {'Param': 'fake_param'}) self.environ = { 'REQUEST_METHOD': 'FAKE', 'ec2.request': ec2_request, 'ec2api.context': self.fake_context } self.request = wsgi.Request(self.environ) self.application = api.Executor()
def setUp(self): super(ApiInitTestCase, self).setUp() controller_patcher = mock.patch('ec2api.api.cloud.VpcCloudController') self.controller_class = controller_patcher.start() self.controller = self.controller_class.return_value self.addCleanup(controller_patcher.stop) self.fake_context = mock.NonCallableMock(request_id=str(uuid.uuid4())) ec2_request = apirequest.APIRequest('FakeAction', 'fake_v1', {'Param': 'fake_param'}) self.environ = { 'REQUEST_METHOD': 'FAKE', 'ec2.request': ec2_request, 'ec2api.context': self.fake_context } self.request = wsgi.Request(self.environ) self.application = api.Executor()
def setUp(self): super(ExecutorTestCase, self).setUp() self.executor = ec2.Executor()