Docs, tests, typing
This commit is contained in:
@@ -94,6 +94,19 @@ def test_container_init():
|
||||
try:
|
||||
cryptbase.cryptbase.CryptoContainer(encryptor=None, plaintext=None)
|
||||
assert False
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
class DummyEncryptor(cryptbase.cryptbase.Encryptor):
|
||||
def encrypt(self, plaintext):
|
||||
return None, None
|
||||
|
||||
def decrypt(self, ct, iv):
|
||||
return None
|
||||
|
||||
try:
|
||||
cryptbase.cryptbase.CryptoContainer(encryptor=DummyEncryptor(), plaintext=None)
|
||||
assert False
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
@@ -112,5 +125,11 @@ def test_container_init():
|
||||
try:
|
||||
cryptbase.cryptbase.CryptoContainer(encryptor=None, ciphertext=None, iv=None)
|
||||
assert False
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
try:
|
||||
cryptbase.cryptbase.CryptoContainer(encryptor=DummyEncryptor(), ciphertext=None, iv=None)
|
||||
assert False
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user