Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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
Пример #4
0
 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