def test_client_httpnotfound_converts_to_imagenotfound(self): in_exc = glanceclient.exc.HTTPNotFound('123') out_exc = glance._translate_image_exception('123', in_exc) self.assertIsInstance(out_exc, exception.ImageNotFound)
def test_client_httpforbidden_converts_to_imagenotauthed(self): in_exc = glanceclient.exc.HTTPForbidden('123') out_exc = glance._translate_image_exception('123', in_exc) self.assertIsInstance(out_exc, exception.ImageNotAuthorized)
def test_client_notfound_converts_to_imagenotfound(self): in_exc = glanceclient.exc.NotFound("123") out_exc = glance._translate_image_exception("123", in_exc) self.assertIsInstance(out_exc, exception.ImageNotFound)
def test_client_forbidden_to_imagenotauthed(self): in_exc = glanceclient.exc.Forbidden("123") out_exc = glance._translate_image_exception("123", in_exc) self.assertIsInstance(out_exc, exception.ImageNotAuthorized)