diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-12 15:53:38 -0500 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-05-12 15:53:38 -0500 |
commit | 6e198b0092a2a320887a234db5227a8c1daa49be (patch) | |
tree | 366f0d3cc7c9ddc3f52fce02636cd8a03f90793c /tests/test_x509_ext.py | |
parent | 75f4118e61a050e3e9f562a4de00a9dd68e1f5c0 (diff) | |
download | cryptography-6e198b0092a2a320887a234db5227a8c1daa49be.tar.gz cryptography-6e198b0092a2a320887a234db5227a8c1daa49be.tar.bz2 cryptography-6e198b0092a2a320887a234db5227a8c1daa49be.zip |
notice_numbers are not optional in NoticeReference
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r-- | tests/test_x509_ext.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index a366265c..701ea167 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -45,9 +45,8 @@ class TestNoticeReference(object): x509.NoticeReference("org", [1, 2, "three"]) def test_notice_numbers_none(self): - nr = x509.NoticeReference("org", None) - assert nr.organization == "org" - assert nr.notice_numbers is None + with pytest.raises(TypeError): + x509.NoticeReference("org", None) def test_repr(self): nr = x509.NoticeReference(u"org", [1, 3, 4]) @@ -88,16 +87,16 @@ class TestUserNotice(object): assert un.explicit_text == "text" def test_repr(self): - un = x509.UserNotice(x509.NoticeReference(u"org", None), u"text") + un = x509.UserNotice(x509.NoticeReference(u"org", [1]), u"text") if six.PY3: assert repr(un) == ( "<UserNotice(notice_reference=<NoticeReference(organization='" - "org', notice_numbers=None)>, explicit_text='text')>" + "org', notice_numbers=[1])>, explicit_text='text')>" ) else: assert repr(un) == ( "<UserNotice(notice_reference=<NoticeReference(organization=u" - "'org', notice_numbers=None)>, explicit_text=u'text')>" + "'org', notice_numbers=[1])>, explicit_text=u'text')>" ) def test_eq(self): |