diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-11 21:22:38 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-11 21:22:38 -0500 |
commit | 73be2ca86049fd15f1ab37d7201a9b32264402ab (patch) | |
tree | e94e1b904c9085d242e4b73ba1562b672e2a0ca3 /tests/test_x509_ext.py | |
parent | 9aaef9e516ae1c54c79f07b0441c21c29f8aeb15 (diff) | |
download | cryptography-73be2ca86049fd15f1ab37d7201a9b32264402ab.tar.gz cryptography-73be2ca86049fd15f1ab37d7201a9b32264402ab.tar.bz2 cryptography-73be2ca86049fd15f1ab37d7201a9b32264402ab.zip |
alter the repr a bit, pass unicode everywhere
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r-- | tests/test_x509_ext.py | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index fa025d9c..ae69f5fc 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -50,11 +50,18 @@ class TestNoticeReference(object): assert nr.notice_numbers is None def test_repr(self): - nr = x509.NoticeReference("org", [1, 3, 4]) + nr = x509.NoticeReference(u"org", [1, 3, 4]) - assert repr(nr) == ( - "<NoticeReference(organization=org, notice_numbers=[1, 3, 4])>" - ) + if six.PY3: + assert repr(nr) == ( + "<NoticeReference(organization='org', notice_numbers=[1, 3, 4" + "])>" + ) + else: + assert repr(nr) == ( + "<NoticeReference(organization=u'org', notice_numbers=[1, 3, " + "4])>" + ) class TestUserNotice(object): @@ -68,11 +75,17 @@ class TestUserNotice(object): assert un.explicit_text == "text" def test_repr(self): - un = x509.UserNotice(x509.NoticeReference("org", None), "text") - assert repr(un) == ( - "<UserNotice(notice_reference=<NoticeReference(organization=org, " - "notice_numbers=None)>, explicit_text='text')>" - ) + un = x509.UserNotice(x509.NoticeReference(u"org", None), u"text") + if six.PY3: + assert repr(un) == ( + "<UserNotice(notice_reference=<NoticeReference(organization='" + "org', notice_numbers=None)>, explicit_text='text')>" + ) + else: + assert repr(un) == ( + "<UserNotice(notice_reference=<NoticeReference(organization=u" + "'org', notice_numbers=None)>, explicit_text=u'text')>" + ) class TestPolicyInformation(object): @@ -96,7 +109,7 @@ class TestPolicyInformation(object): x509.PolicyInformation(x509.ObjectIdentifier("1.2.3"), [1, 2]) def test_repr(self): - pq = [u"string", x509.UserNotice(None, "hi")] + pq = [u"string", x509.UserNotice(None, u"hi")] pi = x509.PolicyInformation(x509.ObjectIdentifier("1.2.3"), pq) if six.PY3: assert repr(pi) == ( @@ -108,7 +121,7 @@ class TestPolicyInformation(object): assert repr(pi) == ( "<PolicyInformation(policy_identifier=<ObjectIdentifier(oid=1." "2.3, name=Unknown OID)>, policy_qualifiers=[u'string', <UserN" - "otice(notice_reference=None, explicit_text='hi')>])>" + "otice(notice_reference=None, explicit_text=u'hi')>])>" ) |