Updates the latest test to use status codes

This commit is contained in:
Trenton H 2023-02-20 08:36:22 -08:00
parent a6e2708605
commit 8df1324afd
2 changed files with 5 additions and 9 deletions

View File

@ -1331,7 +1331,7 @@ class TestDocumentApi(DirectoriesMixin, APITestCase):
{"document": f, "archive_serial_number": 500}, {"document": f, "archive_serial_number": 500},
) )
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, status.HTTP_200_OK)
m.assert_called_once() m.assert_called_once()

View File

@ -92,20 +92,16 @@ class DirectoriesMixin:
class FileSystemAssertsMixin: class FileSystemAssertsMixin:
def assertIsFile(self, path: Union[PathLike, str]): def assertIsFile(self, path: Union[PathLike, str]):
if not Path(path).resolve().is_file(): self.assertTrue(Path(path).resolve().is_file(), f"File does not exist: {path}")
raise AssertionError(f"File does not exist: {path}")
def assertIsNotFile(self, path: Union[PathLike, str]): def assertIsNotFile(self, path: Union[PathLike, str]):
if Path(path).resolve().is_file(): self.assertFalse(Path(path).resolve().is_file(), f"File does exist: {path}")
raise AssertionError(f"File does exist: {path}")
def assertIsDir(self, path: Union[PathLike, str]): def assertIsDir(self, path: Union[PathLike, str]):
if not Path(path).resolve().is_dir(): self.assertTrue(Path(path).resolve().is_dir(), f"Dir does not exist: {path}")
raise AssertionError(f"Dir does not exist: {path}")
def assertIsNotDir(self, path: Union[PathLike, str]): def assertIsNotDir(self, path: Union[PathLike, str]):
if Path(path).resolve().is_dir(): self.assertFalse(Path(path).resolve().is_dir(), f"Dir does exist: {path}")
raise AssertionError(f"Dir does exist: {path}")
class ConsumerProgressMixin: class ConsumerProgressMixin: