From 73be2ca86049fd15f1ab37d7201a9b32264402ab Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 11 May 2015 21:22:38 -0500 Subject: alter the repr a bit, pass unicode everywhere --- tests/test_x509_ext.py | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'tests/test_x509_ext.py') 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) == ( - "" - ) + if six.PY3: + assert repr(nr) == ( + "" + ) + else: + assert repr(nr) == ( + "" + ) 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) == ( - ", explicit_text='text')>" - ) + un = x509.UserNotice(x509.NoticeReference(u"org", None), u"text") + if six.PY3: + assert repr(un) == ( + ", explicit_text='text')>" + ) + else: + assert repr(un) == ( + ", 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) == ( ", policy_qualifiers=[u'string', ])>" + "otice(notice_reference=None, explicit_text=u'hi')>])>" ) -- cgit v1.2.3