aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2015-06-16 19:12:17 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2015-06-16 19:12:17 -0500
commit7618fbeb1fab995f5e44864ba9ace3ebdf4ebc5b (patch)
tree2b171188bf660403523f1ac0783a507b1a15a9e6 /tests
parent926f8ac4927bdc9977f2d960c7def3f2927d1198 (diff)
downloadcryptography-7618fbeb1fab995f5e44864ba9ace3ebdf4ebc5b.tar.gz
cryptography-7618fbeb1fab995f5e44864ba9ace3ebdf4ebc5b.tar.bz2
cryptography-7618fbeb1fab995f5e44864ba9ace3ebdf4ebc5b.zip
Enforce text type of NameAttribute.value
Diffstat (limited to 'tests')
-rw-r--r--tests/test_x509.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_x509.py b/tests/test_x509.py
index a3bed85f..d9aa22db 100644
--- a/tests/test_x509.py
+++ b/tests/test_x509.py
@@ -794,6 +794,13 @@ class TestNameAttribute(object):
with pytest.raises(TypeError):
x509.NameAttribute(None, 'value')
+ def test_init_bad_value(self):
+ with pytest.raises(TypeError):
+ x509.NameAttribute(
+ x509.ObjectIdentifier('oid'),
+ b'bytes'
+ )
+
def test_eq(self):
assert x509.NameAttribute(
x509.ObjectIdentifier('oid'), 'value'