test_cert_plugin: Encode 'certificate' for comparison with 'usercertificate'

The 'certificate' option is Str, but 'usercertificate' is Bytes.
Decode before comparing one with the other.

Part of the work for: https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Petr Viktorin 2016-05-05 16:56:24 +02:00 committed by Martin Basti
parent 5dbb0f6fec
commit 7d4d819b90

View File

@ -149,7 +149,7 @@ class test_cert(XMLRPC_test):
res = api.Command['cert_request'](csr, principal=self.service_princ, add=True)['result']
assert DN(res['subject']) == self.subject
# save the cert for the service_show/find tests
cert = res['certificate']
cert = res['certificate'].encode('ascii')
def test_0003_service_show(self):
"""
@ -180,7 +180,7 @@ class test_cert(XMLRPC_test):
res = api.Command['cert_request'](csr, principal=self.service_princ)['result']
assert DN(res['subject']) == self.subject
# save the cert for the service_show/find tests
newcert = res['certificate']
newcert = res['certificate'].encode('ascii')
def test_0006_service_show(self):
"""