forked from p15670423/monkey
UT: Add tests for EncryptionKey32Bytes
This commit is contained in:
parent
6000fdcaf1
commit
11aff1f7fe
|
@ -0,0 +1,15 @@
|
|||
import pytest
|
||||
|
||||
from monkey_island.cc.server_utils.encryption.encryption_key_types import EncryptionKey32Bytes
|
||||
|
||||
|
||||
@pytest.mark.parametrize("key", ["", 2, []])
|
||||
def test_create_encryption_key_32_bytes__raises_type_error(key):
|
||||
with pytest.raises(TypeError):
|
||||
EncryptionKey32Bytes(key)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("key", [b"", b"less", b"this is something that is longer than 32"])
|
||||
def test_create_encryption_key_32_bytes__raises_value_error(key):
|
||||
with pytest.raises(ValueError):
|
||||
EncryptionKey32Bytes(key)
|
Loading…
Reference in New Issue