def test_fault_call(self): # Ensure proper EC2 response on faults. message = 'test message' ex = webob.exc.HTTPNotFound(explanation=message) fault = faults.Fault(ex) req = Request.blank('/test') req.GET['AWSAccessKeyId'] = "test_user_id:test_project_id" self.mox.StubOutWithMock(faults, 'ec2_error_response') faults.ec2_error_response(mox.IgnoreArg(), 'HTTPNotFound', message=message, status=ex.status_int) self.mox.ReplayAll() fault(req)
def setUp(self): super(Ec2ErrorResponseTestCase, self).setUp() self.context = RequestContext('test_user_id', 'test_project_id') self.req = Request.blank('/test') self.req.environ['nova.context'] = self.context