Gate: fix AttributeError: load_pem_x509_csr
Gate picks cryptography 1.3 version, for x509, it is _ModuleWithDeprecations instead of a module, see https://github.com/pyca/cryptography/issues/2844 . So that will bring trouble when an mocked object __exit__(). This fix is only works for v1.3 cryptography (on gate). Closes-Bug: #1559845 Change-Id: I852e6c5bf4c16b234ba92b2449c09b991fa6c5a0
This commit is contained in:
parent
ddb7eeaab3
commit
a75b5fb77a
|
@ -183,7 +183,9 @@ class TestX509(base.BaseTestCase):
|
|||
|
||||
self.assertInClientExtensions(cert)
|
||||
|
||||
@mock.patch('cryptography.x509.load_pem_x509_csr')
|
||||
# Notes(eliqiao): Remove this '_module' after cryptography issue fixed
|
||||
# https://github.com/pyca/cryptography/issues/2844
|
||||
@mock.patch('cryptography.x509._module.load_pem_x509_csr')
|
||||
@mock.patch('six.b')
|
||||
def test_sign_with_unicode_csr(self, mock_six, mock_load_pem):
|
||||
ca_key = self._generate_private_key()
|
||||
|
|
Loading…
Reference in New Issue