mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-07 23:35:22 +01:00
Updates the latest test to use status codes
This commit is contained in:
parent
a6e2708605
commit
8df1324afd
2 changed files with 5 additions and 9 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue