From 8e2286c9b2d9afb5c1750f2ccf7ec27e8a03e9cf Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Thu, 16 Feb 2023 00:39:03 +0000 Subject: [PATCH] Fix unit tests for python-barbicanclient 5.5.0 Version 5.5.0 of python-barbicanclient adds microversion support, which causes it to call keystoneauth1.discover.get_version_data to get the microversion information from the server. Adding additional mock.patch for keystoneauth1.discover fixes the breaking unit tests. This is a gate fix for the python-barbicanclient upper-constraints bump[1]. [1] https://review.opendev.org/c/openstack/requirements/+/873906 Co-Authored-By: Grzegorz Grasza Change-Id: Ic1c26d255ff0690e327b3cb6c622d3617e02df5f --- heat/tests/clients/test_barbican_client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/heat/tests/clients/test_barbican_client.py b/heat/tests/clients/test_barbican_client.py index 6159ab70ea..4f07dc6817 100644 --- a/heat/tests/clients/test_barbican_client.py +++ b/heat/tests/clients/test_barbican_client.py @@ -32,6 +32,8 @@ class BarbicanClientPluginTest(common.HeatTestCase): self.barbican_plugin = c.client_plugin('barbican') self.barbican_plugin.client = lambda: self.barbican_client + @mock.patch('keystoneauth1.discover.get_version_data', + mock.MagicMock(return_value=[{'status': "STABLE"}])) def test_create(self): context = utils.dummy_context() plugin = context.clients.client_plugin('barbican')