octavia/octavia/tests/unit/certificates
Bodo Petermann a84bf7d843 Fix test_barbican_legacy for Python 3.8
Fixes failing unit tests in
octavia.tests.unit.certificates.manager.test_barbican_legacy.TestBarbicanManager
for Python 3.8

Some of the tests fail setting up a mock.Mock(spec=secrets.Secret)
because a ValueError exception is raised unexpectedly.

The reason is that test_get_cert_no_registration_raise_on_secret_access_failure
patches the `payload` property of barbicanclient.v1.secrets.Secret to
raise a ValueError.
When a subsequent test tries to set up a mock.Mock(spec=secrets.Secret)
in Python 3.8 the Mock class will try to look at the properties of the spec
class and accessing `payload` doesn't behave normally anymore: it raises
ValueError now.

Fixed by using a different approach of mocking `payload` in
test_get_cert_no_registration_raise_on_secret_access_failure
so that it does not influence subsequent tests.

Change-Id: Ic534a4715c85c2216c7251209507acf74a999153
Story: 2007490
Task: 39212
2020-05-29 16:58:33 +02:00
..
common Remove all usage of six library 2020-03-18 17:15:26 -04:00
generator Remove the dependency on the "mock" package 2020-02-17 14:55:19 -08:00
manager Fix test_barbican_legacy for Python 3.8 2020-05-29 16:58:33 +02:00
__init__.py Add license for empty __init__.py 2018-03-14 07:02:56 +09:00