From a908d691490818aa03fbdb0d3f96448e8edbb8cf Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Tue, 16 Jun 2015 21:35:24 -0500 Subject: Conditionally construct the repr of NameAttributes --- tests/test_x509_ext.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'tests/test_x509_ext.py') diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index de8aea98..d836164b 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -633,7 +633,7 @@ class TestAuthorityKeyIdentifier(object): assert repr(aki) == ( ", value=u'myC" + ", value='myC" "N')>])>)>], authority_cert_serial_number=1234)>" ) else: @@ -1050,10 +1050,18 @@ class TestDirectoryName(object): def test_repr(self): name = x509.Name([x509.NameAttribute(x509.OID_COMMON_NAME, u'value1')]) gn = x509.DirectoryName(x509.Name([name])) - assert repr(gn) == ( - ", value=u'value1')>])>])>)>" - ) + if six.PY3: + assert repr(gn) == ( + ", value='value1')>])" + ">])>)>" + ) + else: + assert repr(gn) == ( + ", value=u'value1')>]" + ")>])>)>" + ) def test_eq(self): name = x509.Name([ @@ -2017,10 +2025,10 @@ class TestDistributionPoint(object): assert repr(dp) == ( ", value=u'myCN')>])>, reasons=frozenset({}), crl_issuer=[, value=u'Important CA')>])>)>])>" + ">, value='myCN')>])>, reasons=frozenset({}), crl_issuer=[, value='Important CA')>])>)>])>" ) else: assert repr(dp) == ( -- cgit v1.2.3