mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-16 21:55:37 -05:00
Updates the latest test to use status codes
This commit is contained in:
@@ -92,20 +92,16 @@ class DirectoriesMixin:
|
||||
|
||||
class FileSystemAssertsMixin:
|
||||
def assertIsFile(self, path: Union[PathLike, str]):
|
||||
if not Path(path).resolve().is_file():
|
||||
raise AssertionError(f"File does not exist: {path}")
|
||||
self.assertTrue(Path(path).resolve().is_file(), f"File does not exist: {path}")
|
||||
|
||||
def assertIsNotFile(self, path: Union[PathLike, str]):
|
||||
if Path(path).resolve().is_file():
|
||||
raise AssertionError(f"File does exist: {path}")
|
||||
self.assertFalse(Path(path).resolve().is_file(), f"File does exist: {path}")
|
||||
|
||||
def assertIsDir(self, path: Union[PathLike, str]):
|
||||
if not Path(path).resolve().is_dir():
|
||||
raise AssertionError(f"Dir does not exist: {path}")
|
||||
self.assertTrue(Path(path).resolve().is_dir(), f"Dir does not exist: {path}")
|
||||
|
||||
def assertIsNotDir(self, path: Union[PathLike, str]):
|
||||
if Path(path).resolve().is_dir():
|
||||
raise AssertionError(f"Dir does exist: {path}")
|
||||
self.assertFalse(Path(path).resolve().is_dir(), f"Dir does exist: {path}")
|
||||
|
||||
|
||||
class ConsumerProgressMixin:
|
||||
|
Reference in New Issue
Block a user