diff --git a/monkey/common/credentials/__init__.py b/monkey/common/credentials/__init__.py index 92a778886..f49f6af03 100644 --- a/monkey/common/credentials/__init__.py +++ b/monkey/common/credentials/__init__.py @@ -1,8 +1,12 @@ from .credential_component_type import CredentialComponentType from .i_credential_component import ICredentialComponent -from .credentials import Credentials + +from .validators import InvalidCredentialComponent + from .lm_hash import LMHash from .nt_hash import NTHash from .password import Password from .ssh_keypair import SSHKeypair from .username import Username + +from .credentials import Credentials diff --git a/monkey/tests/unit_tests/common/credentials/test_ntlm_hash.py b/monkey/tests/unit_tests/common/credentials/test_ntlm_hash.py index ee41a2318..28f7bcaae 100644 --- a/monkey/tests/unit_tests/common/credentials/test_ntlm_hash.py +++ b/monkey/tests/unit_tests/common/credentials/test_ntlm_hash.py @@ -1,6 +1,6 @@ import pytest -from common.credentials import LMHash, NTHash +from common.credentials import InvalidCredentialComponent, LMHash, NTHash VALID_HASH = "E520AC67419A9A224A3B108F3FA6CB6D" INVALID_HASHES = ( @@ -22,5 +22,5 @@ def test_construct_valid_ntlm_hash(ntlm_hash_class): @pytest.mark.parametrize("ntlm_hash_class", (LMHash, NTHash)) def test_construct_invalid_ntlm_hash(ntlm_hash_class): for invalid_hash in INVALID_HASHES: - with pytest.raises(Exception): + with pytest.raises(InvalidCredentialComponent): ntlm_hash_class(invalid_hash)