tests: Address UserWarning in tests

Address the following warning raised when running tests:

  .../oslo_i18n/_message.py:173: UserWarning: Failed to insert
  replacement values into translated message Key manager error:
  %(reason)s (Original: 'Key manager error: %(reason)s'): 'reason'
    warnings.warn(msg % (translated_message, self.msgid, err))

Change-Id: I651b2dde7af462cd980d07d4b247cfac4896b76e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2022-06-16 11:25:57 +01:00
parent 2a4b304ced
commit 4754451138

View File

@ -667,8 +667,10 @@ class CreateVolumeFlowTestCase(test.TestCase):
fake_key_manager = mock_key_manager.MockKeyManager() fake_key_manager = mock_key_manager.MockKeyManager()
volume_type = {'name': 'type1', 'id': 1} volume_type = {'name': 'type1', 'id': 1}
with mock.patch.object(fake_key_manager, 'create_key', with mock.patch.object(
side_effect=castellan_exc.KeyManagerError): fake_key_manager, 'create_key',
side_effect=castellan_exc.KeyManagerError('foo')
):
with mock.patch.object(fake_key_manager, 'get', with mock.patch.object(fake_key_manager, 'get',
return_value=fakes.ENCRYPTION_KEY_ID): return_value=fakes.ENCRYPTION_KEY_ID):