Common: Export InvalidCredentialComponent from common.credentials

This commit is contained in:
Mike Salvatore 2022-07-06 19:32:18 -04:00
parent d3859debbe
commit 82ce091063
2 changed files with 7 additions and 3 deletions

View File

@ -1,8 +1,12 @@
from .credential_component_type import CredentialComponentType from .credential_component_type import CredentialComponentType
from .i_credential_component import ICredentialComponent from .i_credential_component import ICredentialComponent
from .credentials import Credentials
from .validators import InvalidCredentialComponent
from .lm_hash import LMHash from .lm_hash import LMHash
from .nt_hash import NTHash from .nt_hash import NTHash
from .password import Password from .password import Password
from .ssh_keypair import SSHKeypair from .ssh_keypair import SSHKeypair
from .username import Username from .username import Username
from .credentials import Credentials

View File

@ -1,6 +1,6 @@
import pytest import pytest
from common.credentials import LMHash, NTHash from common.credentials import InvalidCredentialComponent, LMHash, NTHash
VALID_HASH = "E520AC67419A9A224A3B108F3FA6CB6D" VALID_HASH = "E520AC67419A9A224A3B108F3FA6CB6D"
INVALID_HASHES = ( INVALID_HASHES = (
@ -22,5 +22,5 @@ def test_construct_valid_ntlm_hash(ntlm_hash_class):
@pytest.mark.parametrize("ntlm_hash_class", (LMHash, NTHash)) @pytest.mark.parametrize("ntlm_hash_class", (LMHash, NTHash))
def test_construct_invalid_ntlm_hash(ntlm_hash_class): def test_construct_invalid_ntlm_hash(ntlm_hash_class):
for invalid_hash in INVALID_HASHES: for invalid_hash in INVALID_HASHES:
with pytest.raises(Exception): with pytest.raises(InvalidCredentialComponent):
ntlm_hash_class(invalid_hash) ntlm_hash_class(invalid_hash)