Example #1
0
    def test_delete_not_found(self):
        fake_not_found = exception.MessageNotFound(message_id=fakes.FAKE_UUID)
        self.mock_object(message_api.API, 'get',
                         mock.Mock(side_effect=fake_not_found))

        req = fakes.HTTPRequest.blank(
            '/messages/%s' % fakes.FAKE_UUID,
            version=messages.MESSAGES_BASE_MICRO_VERSION)

        self.assertRaises(webob.exc.HTTPNotFound, self.controller.delete, req,
                          fakes.FAKE_UUID)
Example #2
0
    def test_show_not_found(self):
        fake_not_found = exception.MessageNotFound(message_id=fakes.FAKE_UUID)
        self.mock_object(message_api.API, 'get',
                         mock.Mock(side_effect=fake_not_found))

        req = fakes.HTTPRequest.blank(
            '/messages/%s' % fakes.FAKE_UUID,
            version=messages.MESSAGES_BASE_MICRO_VERSION,
            base_url='http://localhost/v2')
        req.environ['manila.context'] = self.ctxt

        self.assertRaises(webob.exc.HTTPNotFound, self.controller.show, req,
                          fakes.FAKE_UUID)