refactor crypto tests into a package

This commit is contained in:
Thomas Waldmann 2025-06-11 23:17:02 +02:00
parent 78679f8912
commit 7329efba14
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
8 changed files with 25 additions and 25 deletions

View file

@ -21,7 +21,7 @@ import sys
import time
from unittest import TestResult, TestSuite, defaultTestLoader
from .testsuite.crypto_test import CryptoTestCase
from .testsuite.crypto.crypto_test import CryptoTestCase
from .testsuite.chunkers.buzhash_self_test import ChunkerTestCase
from .testsuite.chunkers.fixed_self_test import ChunkerFixedTestCase

View file

@ -10,7 +10,7 @@ from ...helpers import CommandError
from ...helpers import bin_to_hex, hex_to_bin
from ...helpers import msgpack
from ...repository import Repository
from ..key_test import TestKey
from ..crypto.key_test import TestKey
from . import RK_ENCRYPTION, KF_ENCRYPTION, cmd, _extract_repository_id, _set_repository_id, generate_archiver_tests
pytest_generate_tests = lambda metafunc: generate_archiver_tests(metafunc, kinds="local,remote,binary") # NOQA

View file

@ -3,7 +3,7 @@ import os
import pytest
from .hashindex_test import H
from .key_test import TestKey
from .crypto.key_test import TestKey
from ..archive import Statistics
from ..cache import AdHocWithFilesCache
from ..crypto.key import AESOCBRepoKey

View file

View file

@ -4,14 +4,14 @@
from unittest.mock import MagicMock
import unittest
from ..crypto.low_level import AES256_CTR_HMAC_SHA256, AES256_OCB, CHACHA20_POLY1305, UNENCRYPTED, IntegrityError
from ..crypto.low_level import bytes_to_long, bytes_to_int, long_to_bytes
from ..crypto.low_level import AES, hmac_sha256
from ...crypto.low_level import AES256_CTR_HMAC_SHA256, AES256_OCB, CHACHA20_POLY1305, UNENCRYPTED, IntegrityError
from ...crypto.low_level import bytes_to_long, bytes_to_int, long_to_bytes
from ...crypto.low_level import AES, hmac_sha256
from hashlib import sha256
from ..crypto.key import CHPOKeyfileKey, AESOCBRepoKey, FlexiKey, KeyBase, PlaintextKey
from ..helpers import msgpack, bin_to_hex
from ...crypto.key import CHPOKeyfileKey, AESOCBRepoKey, FlexiKey, KeyBase, PlaintextKey
from ...helpers import msgpack, bin_to_hex
from . import BaseTestCase
from .. import BaseTestCase
class CryptoTestCase(BaseTestCase):

View file

@ -1,6 +1,6 @@
import pytest
from ..crypto.file_integrity import DetachedIntegrityCheckedFile, FileIntegrityError
from ...crypto.file_integrity import DetachedIntegrityCheckedFile, FileIntegrityError
class TestReadIntegrityFile:

View file

@ -4,20 +4,20 @@ from unittest.mock import MagicMock
import pytest
from ..crypto.key import PlaintextKey, AuthenticatedKey, Blake2AuthenticatedKey
from ..crypto.key import RepoKey, KeyfileKey, Blake2RepoKey, Blake2KeyfileKey
from ..crypto.key import AEADKeyBase
from ..crypto.key import AESOCBRepoKey, AESOCBKeyfileKey, CHPORepoKey, CHPOKeyfileKey
from ..crypto.key import Blake2AESOCBRepoKey, Blake2AESOCBKeyfileKey, Blake2CHPORepoKey, Blake2CHPOKeyfileKey
from ..crypto.key import ID_HMAC_SHA_256, ID_BLAKE2b_256
from ..crypto.key import UnsupportedManifestError, UnsupportedKeyFormatError
from ..crypto.key import identify_key
from ..crypto.low_level import IntegrityError as IntegrityErrorBase
from ..helpers import IntegrityError
from ..helpers import Location
from ..helpers import msgpack
from ..constants import KEY_ALGORITHMS
from ..helpers import hex_to_bin, bin_to_hex
from ...crypto.key import PlaintextKey, AuthenticatedKey, Blake2AuthenticatedKey
from ...crypto.key import RepoKey, KeyfileKey, Blake2RepoKey, Blake2KeyfileKey
from ...crypto.key import AEADKeyBase
from ...crypto.key import AESOCBRepoKey, AESOCBKeyfileKey, CHPORepoKey, CHPOKeyfileKey
from ...crypto.key import Blake2AESOCBRepoKey, Blake2AESOCBKeyfileKey, Blake2CHPORepoKey, Blake2CHPOKeyfileKey
from ...crypto.key import ID_HMAC_SHA_256, ID_BLAKE2b_256
from ...crypto.key import UnsupportedManifestError, UnsupportedKeyFormatError
from ...crypto.key import identify_key
from ...crypto.low_level import IntegrityError as IntegrityErrorBase
from ...helpers import IntegrityError
from ...helpers import Location
from ...helpers import msgpack
from ...constants import KEY_ALGORITHMS
from ...helpers import hex_to_bin, bin_to_hex
class TestKey:

View file

@ -14,7 +14,7 @@ from ..helpers import IntegrityError
from ..repoobj import RepoObj
from .hashindex_test import H
from .repository_test import fchunk, pdchunk
from .key_test import TestKey
from .crypto.key_test import TestKey
class TestSleepingBandwidthLimiter: