From 388d1bd3e9cd953fcc948edbc152d5d140c87eb8 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Mon, 5 Mar 2018 11:36:08 -0400 Subject: don't allow GeneralNames to be an empty list (#4128) * don't allow GeneralNames to be an empty list * flake8 --- tests/x509/test_x509_ext.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/x509/test_x509_ext.py b/tests/x509/test_x509_ext.py index 9f4e1758..b048c140 100644 --- a/tests/x509/test_x509_ext.py +++ b/tests/x509/test_x509_ext.py @@ -2052,6 +2052,10 @@ class TestGeneralNames(object): [x509.DNSName(u"cryptography.io"), "invalid"] ) + def test_does_not_allow_empty_list(self): + with pytest.raises(ValueError): + x509.GeneralNames([]) + def test_repr(self): gns = x509.GeneralNames( [ -- cgit v1.2.3