Fix unit tests to work with stevedore > 2.0.1
stevedore has switched to importlib_metadata[1] and this breaked unit test as the test relied on internal implementation of it. Instead we should switch to mock NamedExtensionManager that's what called by oslo_policy. [1] https://review.opendev.org/#/c/739306/ Closes-Bug: #1888208 Change-Id: I993d743c53fa3506ceda3d1f291c12f4635eb60a
This commit is contained in:
parent
cab28649c6
commit
6296fce9f8
|
@ -492,8 +492,8 @@ class GeneratorRaiseErrorTestCase(testtools.TestCase):
|
|||
raise FakeException()
|
||||
|
||||
fake_ep = FakeEP()
|
||||
fake_eps = mock.Mock(return_value=[fake_ep])
|
||||
with mock.patch('pkg_resources.iter_entry_points', fake_eps):
|
||||
with mock.patch('stevedore.named.NamedExtensionManager',
|
||||
side_effect=FakeException()):
|
||||
self.assertRaises(FakeException, generator._generate_sample,
|
||||
fake_ep.name)
|
||||
|
||||
|
|
Loading…
Reference in New Issue