mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-15 02:57:09 +01:00
fix conditional in separate_pages
add additional test for separate_pages Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
This commit is contained in:
parent
cdf5602dfb
commit
5fae5a9ee0
2 changed files with 37 additions and 17 deletions
|
|
@ -312,6 +312,23 @@ class TestTasks(DirectoriesMixin, TestCase):
|
|||
pages = tasks.separate_pages(test_file, [1])
|
||||
self.assertEqual(len(pages), 2)
|
||||
|
||||
def test_separate_pages_no_list(self):
|
||||
test_file = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
"samples",
|
||||
"barcodes",
|
||||
"patch-code-t-middle.pdf",
|
||||
)
|
||||
with self.assertLogs("paperless.tasks", level="WARNING") as cm:
|
||||
pages = tasks.separate_pages(test_file, [])
|
||||
self.assertEqual(pages, [])
|
||||
self.assertEqual(
|
||||
cm.output,
|
||||
[
|
||||
f"WARNING:paperless.tasks:No pages to split on!",
|
||||
],
|
||||
)
|
||||
|
||||
def test_save_to_dir(self):
|
||||
test_file = os.path.join(
|
||||
os.path.dirname(__file__),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue