Merge "Require more specific exception"

This commit is contained in:
Zuul 2024-03-07 09:36:31 +00:00 committed by Gerrit Code Review
commit bc2b5326fa

View File

@ -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)