From 4754451138bbdccb3917955ef217bd0ce8587f3e Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 16 Jun 2022 11:25:57 +0100 Subject: [PATCH] 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 --- cinder/tests/unit/volume/flows/test_create_volume_flow.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cinder/tests/unit/volume/flows/test_create_volume_flow.py b/cinder/tests/unit/volume/flows/test_create_volume_flow.py index 2a7b625bc95..5b4ddb35f3e 100644 --- a/cinder/tests/unit/volume/flows/test_create_volume_flow.py +++ b/cinder/tests/unit/volume/flows/test_create_volume_flow.py @@ -667,8 +667,10 @@ class CreateVolumeFlowTestCase(test.TestCase): fake_key_manager = mock_key_manager.MockKeyManager() volume_type = {'name': 'type1', 'id': 1} - with mock.patch.object(fake_key_manager, 'create_key', - side_effect=castellan_exc.KeyManagerError): + with mock.patch.object( + fake_key_manager, 'create_key', + side_effect=castellan_exc.KeyManagerError('foo') + ): with mock.patch.object(fake_key_manager, 'get', return_value=fakes.ENCRYPTION_KEY_ID):