From 1fb35c9e0dc716571dca894075c59f3ed60f47f3 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 11 Apr 2015 15:42:54 -0400 Subject: add repr for x509 names --- tests/test_x509.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/test_x509.py b/tests/test_x509.py index dc148d9d..7e7d4dd9 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -607,3 +607,15 @@ class TestName(object): ]) assert name1 != name2 assert name1 != object() + + def test_repr(self): + name = x509.Name([ + x509.NameAttribute(x509.OID_COMMON_NAME, 'cryptography.io'), + x509.NameAttribute(x509.OID_ORGANIZATION_NAME, 'PyCA'), + ]) + + assert repr(name) == ( + "[, value='cryptography.io')>, , value='PyCA')>]" + ) -- cgit v1.2.3 From e613e5d8d922d7617409b878b3c2450eb9d21877 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 11 Apr 2015 15:52:04 -0400 Subject: let's make that repr actually good --- tests/test_x509.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/test_x509.py b/tests/test_x509.py index 7e7d4dd9..d8a4cc02 100644 --- a/tests/test_x509.py +++ b/tests/test_x509.py @@ -615,7 +615,8 @@ class TestName(object): ]) assert repr(name) == ( - "[, value='cryptography.io')>, , value='PyCA')>]" + ", value='cryptography.io')>, , value='PyCA')>])" + ">" ) -- cgit v1.2.3