Skip to content

Commit cd07d84

Browse files
Merge pull request #8918 from ThomasWaldmann/modularize-tests
Modularize tests
2 parents a44e259 + 394cec6 commit cd07d84

21 files changed

Lines changed: 43 additions & 43 deletions

src/borg/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from borg.testsuite import has_lchflags, has_llfuse, has_pyfuse3 # noqa: E402
1515
from borg.testsuite import are_symlinks_supported, are_hardlinks_supported, is_utime_fully_supported # noqa: E402
1616
from borg.testsuite.archiver import BORG_EXES
17-
from borg.testsuite.platform_test import fakeroot_detected # noqa: E402
17+
from borg.testsuite.platform.platform_test import fakeroot_detected # noqa: E402
1818

1919

2020
@pytest.fixture(autouse=True)

src/borg/selftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import time
2222
from unittest import TestResult, TestSuite, defaultTestLoader
2323

24-
from .testsuite.crypto_test import CryptoTestCase
24+
from .testsuite.crypto.crypto_test import CryptoTestCase
2525
from .testsuite.chunkers.buzhash_self_test import ChunkerTestCase
2626
from .testsuite.chunkers.fixed_self_test import ChunkerFixedTestCase
2727

src/borg/testsuite/archiver/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from .. import has_lchflags, is_utime_fully_supported, have_fuse_mtime_ns, st_mtime_ns_round, no_selinux
3030
from .. import changedir
3131
from .. import are_symlinks_supported, are_hardlinks_supported, are_fifos_supported
32-
from ..platform_test import is_win32
32+
from ..platform.platform_test import is_win32
3333
from ...xattr import get_all
3434

3535
RK_ENCRYPTION = "--encryption=repokey-aes-ocb"

src/borg/testsuite/archiver/key_cmds_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ...helpers import bin_to_hex, hex_to_bin
1111
from ...helpers import msgpack
1212
from ...repository import Repository
13-
from ..key_test import TestKey
13+
from ..crypto.key_test import TestKey
1414
from . import RK_ENCRYPTION, KF_ENCRYPTION, cmd, _extract_repository_id, _set_repository_id, generate_archiver_tests
1515

1616
pytest_generate_tests = lambda metafunc: generate_archiver_tests(metafunc, kinds="local,remote,binary") # NOQA

src/borg/testsuite/archiver/mount_cmds_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .. import has_lchflags, llfuse
1313
from .. import changedir, no_selinux, same_ts_ns
1414
from .. import are_symlinks_supported, are_hardlinks_supported, are_fifos_supported
15-
from ..platform_test import fakeroot_detected
15+
from ..platform.platform_test import fakeroot_detected
1616
from . import RK_ENCRYPTION, cmd, assert_dirs_equal, create_regular_file, create_src_archive, open_archive, src_file
1717
from . import requires_hardlinks, _extract_hardlinks_setup, fuse_mount, create_test_files, generate_archiver_tests
1818

src/borg/testsuite/archiver/transfer_cmd_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from ...helpers import open_item
1414
from ...helpers.time import parse_timestamp
1515
from ...helpers.parseformat import parse_file_size, ChunkerParams
16-
from ..platform_test import is_win32
16+
from ..platform.platform_test import is_win32
1717
from . import cmd, create_regular_file, create_test_files, RK_ENCRYPTION, open_archive, generate_archiver_tests
1818

1919
pytest_generate_tests = lambda metafunc: generate_archiver_tests(metafunc, kinds="local,remote") # NOQA

src/borg/testsuite/cache_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44

55
from .hashindex_test import H
6-
from .key_test import TestKey
6+
from .crypto.key_test import TestKey
77
from ..archive import Statistics
88
from ..cache import AdHocWithFilesCache
99
from ..crypto.key import AESOCBRepoKey

src/borg/testsuite/crypto/__init__.py

Whitespace-only changes.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
from unittest.mock import MagicMock
55
import unittest
66

7-
from ..crypto.low_level import AES256_CTR_HMAC_SHA256, AES256_OCB, CHACHA20_POLY1305, UNENCRYPTED, IntegrityError
8-
from ..crypto.low_level import bytes_to_long, bytes_to_int, long_to_bytes
9-
from ..crypto.low_level import AES, hmac_sha256
7+
from ...crypto.low_level import AES256_CTR_HMAC_SHA256, AES256_OCB, CHACHA20_POLY1305, UNENCRYPTED, IntegrityError
8+
from ...crypto.low_level import bytes_to_long, bytes_to_int, long_to_bytes
9+
from ...crypto.low_level import AES, hmac_sha256
1010
from hashlib import sha256
11-
from ..crypto.key import CHPOKeyfileKey, AESOCBRepoKey, FlexiKey, KeyBase, PlaintextKey
12-
from ..helpers import msgpack, bin_to_hex
11+
from ...crypto.key import CHPOKeyfileKey, AESOCBRepoKey, FlexiKey, KeyBase, PlaintextKey
12+
from ...helpers import msgpack, bin_to_hex
1313

14-
from . import BaseTestCase
14+
from .. import BaseTestCase
1515

1616

1717
class CryptoTestCase(BaseTestCase):

src/borg/testsuite/file_integrity_test.py renamed to src/borg/testsuite/crypto/file_integrity_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from ..crypto.file_integrity import DetachedIntegrityCheckedFile, FileIntegrityError
3+
from ...crypto.file_integrity import DetachedIntegrityCheckedFile, FileIntegrityError
44

55

66
class TestReadIntegrityFile:

0 commit comments

Comments
 (0)