aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_x509.py
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2015-04-12 07:08:26 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2015-04-12 07:08:26 -0400
commitb8d29e0dcbfea18cac85e41b13391ddd481be816 (patch)
treede1b75c44339932db5f446cb6febbe69cd0017d4 /tests/test_x509.py
parent412a273d45c00dd7a58fe64390fddad74d12f453 (diff)
parentf4ed10afd78fcd013ed17fd9305f33f07c4a6e7b (diff)
downloadcryptography-b8d29e0dcbfea18cac85e41b13391ddd481be816.tar.gz
cryptography-b8d29e0dcbfea18cac85e41b13391ddd481be816.tar.bz2
cryptography-b8d29e0dcbfea18cac85e41b13391ddd481be816.zip
Merge pull request #1833 from reaperhulk/x509-name-repr
add repr for x509 names
Diffstat (limited to 'tests/test_x509.py')
-rw-r--r--tests/test_x509.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index dc148d9d..d8a4cc02 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -607,3 +607,16 @@ 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) == (
+ "<Name([<NameAttribute(oid=<ObjectIdentifier(oid=2.5.4.3, name=com"
+ "monName)>, value='cryptography.io')>, <NameAttribute(oid=<ObjectI"
+ "dentifier(oid=2.5.4.10, name=organizationName)>, value='PyCA')>])"
+ ">"
+ )