mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-20 13:36:45 +01:00
Feature: Allow a data only export/import cycle (#6871)
This commit is contained in:
parent
04f52f553a
commit
085447e7c4
6 changed files with 331 additions and 234 deletions
|
|
@ -156,10 +156,6 @@ class DirectoriesMixin:
|
|||
they are cleaned up on exit
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.dirs = None
|
||||
|
||||
def setUp(self) -> None:
|
||||
self.dirs = setup_directories()
|
||||
super().setUp()
|
||||
|
|
@ -200,6 +196,16 @@ class FileSystemAssertsMixin:
|
|||
|
||||
self.assertEqual(hash1, hash2, "File SHA256 mismatch")
|
||||
|
||||
def assertFileCountInDir(self, path: Union[PathLike, str], count: int):
|
||||
path = Path(path).resolve()
|
||||
self.assertTrue(path.is_dir(), f"Path {path} is not a directory")
|
||||
files = [x for x in path.iterdir() if x.is_file()]
|
||||
self.assertEqual(
|
||||
len(files),
|
||||
count,
|
||||
f"Path {path} contains {len(files)} files instead of {count} files",
|
||||
)
|
||||
|
||||
|
||||
class ConsumerProgressMixin:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue