mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-08 09:07:13 +00:00
Rewrites the email parsing to be more clear and concise.
Adds testing to use httpx mocked responses to stand in as a server even offline
This commit is contained in:
1 parent
6e65558ea4
commit
2c1cd25be4
9 files changed
+700
-822
No files matched your search
@@ -105,6 +105,20 @@ class FileSystemAssertsMixin:
|
||||
def assertIsNotDir(self, path: Union[PathLike, str]):
|
||||
self.assertFalse(Path(path).resolve().is_dir(), f"Dir does exist: {path}")
|
||||
|
||||
def assertFilesEqual(
|
||||
self,
|
||||
path1: Union[PathLike, str],
|
||||
path2: Union[PathLike, str],
|
||||
):
|
||||
path1 = Path(path1)
|
||||
path2 = Path(path2)
|
||||
import hashlib
|
||||
|
||||
hash1 = hashlib.sha256(path1.read_bytes()).hexdigest()
|
||||
hash2 = hashlib.sha256(path2.read_bytes()).hexdigest()
|
||||
|
||||
self.assertEqual(hash1, hash2, "File SHA256 mismatch")
|
||||
|
||||
|
||||
class ConsumerProgressMixin:
|
||||
def setUp(self) -> None:
|
||||
|
||||
Reference in new issue
Block a user