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 <xek@redhat.com>
Change-Id: Ic1c26d255ff0690e327b3cb6c622d3617e02df5f
This commit is contained in:
Michael Johnson 2023-02-16 00:39:03 +00:00
parent 85480f94dc
commit 8e2286c9b2

View File

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