mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-19 04:56:53 +01:00
Development: fix unreachable code around assertRaises blocks (#11365)
* tests: general cleanup and fixes for runnning under docker This now allows tests to be run under a locally built or production docker image with something like: `docker run --rm -v $PWD:/usr/src/paperless --entrypoint=bash paperlessngx/paperless-ngx:latest -c "uv run pytest"` Specific fixes: - fix unreachable code around `assertRaises` blocks - fix `assertInt` typos - fix `str(e)` vs `str(e.exception)` issues - skip permission-based checks when root (in a docker container) - catch `OSError` problems when instantiating `INotify` and skip inotify-based tests when it's unavailable. * Reverts most files to dev while keeping the exception assert fixes --------- Co-authored-by: Trenton H <797416+stumpylog@users.noreply.github.com>
This commit is contained in:
parent
4bf681387a
commit
36d45ecf4d
3 changed files with 26 additions and 24 deletions
|
|
@ -571,7 +571,7 @@ class TestExportImport(
|
|||
with self.assertRaises(CommandError) as e:
|
||||
call_command(*args)
|
||||
|
||||
self.assertEqual("That path isn't a directory", str(e))
|
||||
self.assertEqual("That path doesn't exist", str(e.exception))
|
||||
|
||||
def test_export_target_exists_but_is_file(self):
|
||||
"""
|
||||
|
|
@ -589,7 +589,7 @@ class TestExportImport(
|
|||
with self.assertRaises(CommandError) as e:
|
||||
call_command(*args)
|
||||
|
||||
self.assertEqual("That path isn't a directory", str(e))
|
||||
self.assertEqual("That path isn't a directory", str(e.exception))
|
||||
|
||||
def test_export_target_not_writable(self):
|
||||
"""
|
||||
|
|
@ -608,7 +608,10 @@ class TestExportImport(
|
|||
with self.assertRaises(CommandError) as e:
|
||||
call_command(*args)
|
||||
|
||||
self.assertEqual("That path doesn't appear to be writable", str(e))
|
||||
self.assertEqual(
|
||||
"That path doesn't appear to be writable",
|
||||
str(e.exception),
|
||||
)
|
||||
|
||||
def test_no_archive(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue