mirror of
https://github.com/saymrwulf/cryptography.git
synced 2026-05-14 20:37:55 +00:00
Handle non-iterable arguments reasonable
This commit is contained in:
parent
d5b592d95d
commit
4f286cec7a
2 changed files with 5 additions and 0 deletions
|
|
@ -131,6 +131,7 @@ class Fernet(object):
|
|||
|
||||
class MultiFernet(object):
|
||||
def __init__(self, fernets):
|
||||
fernets = list(fernets)
|
||||
if not fernets:
|
||||
raise ValueError(
|
||||
"MultiFernet requires at least one Fernet instance"
|
||||
|
|
|
|||
|
|
@ -146,3 +146,7 @@ class TestMultiFernet(object):
|
|||
def test_no_fernets(self, backend):
|
||||
with pytest.raises(ValueError):
|
||||
MultiFernet([])
|
||||
|
||||
def test_non_iterable_argument(self, backend):
|
||||
with pytest.raises(TypeError):
|
||||
MultiFernet(None)
|
||||
|
|
|
|||
Loading…
Reference in a new issue