Merge "Fix test_barbican_legacy for Python 3.8"

changes/11/656811/7
Zuul 2 years ago committed by Gerrit Code Review
commit be2acaeb36
  1. 29
      octavia/tests/unit/certificates/manager/test_barbican_legacy.py

@ -238,20 +238,21 @@ class TestBarbicanManager(base.TestCase):
def test_get_cert_no_registration_raise_on_secret_access_failure(self):
self.bc.containers.get.return_value = self.container
type(self.certificate).payload = mock.PropertyMock(
side_effect=ValueError)
# Get the container data
self.assertRaises(
ValueError, self.cert_manager.get_cert,
context=self.context,
cert_ref=self.container_ref, check_only=True
)
# 'get' should be called once with the container_ref
self.bc.containers.get.assert_called_once_with(
container_ref=self.container_ref
)
with mock.patch('barbicanclient.v1.secrets.Secret.payload',
new_callable=mock.PropertyMock) as mock_payload:
mock_payload.side_effect = ValueError
# Get the container data
self.assertRaises(
ValueError, self.cert_manager.get_cert,
context=self.context,
cert_ref=self.container_ref, check_only=True
)
# 'get' should be called once with the container_ref
self.bc.containers.get.assert_called_once_with(
container_ref=self.container_ref
)
def test_delete_cert(self):
# Attempt to deregister as a consumer

Loading…
Cancel
Save