コード例 #1
0
ファイル: test_faults.py プロジェクト: bcwaldon/nova
 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
ファイル: test_error_response.py プロジェクト: DrZaarlon/nova
 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