From 7618fbeb1fab995f5e44864ba9ace3ebdf4ebc5b Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Tue, 16 Jun 2015 19:12:17 -0500 Subject: Enforce text type of NameAttribute.value --- tests/test_x509.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') 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' -- cgit v1.2.3