From 211fdbab2885fd7e8741a4d824bb3cb5724c97be Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 5 Mar 2024 13:58:41 +0900 Subject: [PATCH] Require more specific exception This is follow-up of 1e683483e72dfc25da81d9b376cf6963f87b0af7 and replaces the generic Exception asserted in a unit tests by the specific castellan exception, according to the 4.4.0 release. This change does not bump minimum required version of castellan because the version requirement only affects unit tests. Depends-on: https://review.opendev.org/c/openstack/requirements/+/911059 Change-Id: Id1ed909f179038713d9da2fd72cf39e7fb7c8dfe --- glance/tests/unit/v2/test_images_resource.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/glance/tests/unit/v2/test_images_resource.py b/glance/tests/unit/v2/test_images_resource.py index c9b5b6b5de..da340253cc 100644 --- a/glance/tests/unit/v2/test_images_resource.py +++ b/glance/tests/unit/v2/test_images_resource.py @@ -3877,9 +3877,7 @@ class TestImagesController(base.IsolatedUnitTest): virtual_size=3072, extra_properties=props) self.controller._delete_encryption_key(request.context, image) # Make sure the encryption key is gone - # TODO(tkajinam): Replace Exception by ManagedObjectNotFoundError once - # castellan in u-c is bumped to 4.4.0 - self.assertRaises(Exception, # noqa + self.assertRaises(castellan_exception.ManagedObjectNotFoundError, self.controller._key_manager.get, request.context, fake_encryption_key)