From: Florian Brandes Date: Sat, 2 Apr 2022 08:21:51 +0000 (+0200) Subject: add more tests X-Git-Tag: beta-1.7.0-rc1~5^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e214f719c9555542bd05f9410198d73f261bb93a;p=thirdparty%2Fpaperless-ngx.git add more tests Signed-off-by: Florian Brandes --- diff --git a/src/documents/tests/samples/barcodes/patch-code-t-middle_reverse.pdf b/src/documents/tests/samples/barcodes/patch-code-t-middle_reverse.pdf new file mode 100644 index 0000000000..e1f8bc39c0 Binary files /dev/null and b/src/documents/tests/samples/barcodes/patch-code-t-middle_reverse.pdf differ diff --git a/src/documents/tests/samples/barcodes/several-patcht-codes.pdf b/src/documents/tests/samples/barcodes/several-patcht-codes.pdf new file mode 100644 index 0000000000..de4c715c82 Binary files /dev/null and b/src/documents/tests/samples/barcodes/several-patcht-codes.pdf differ diff --git a/src/documents/tests/test_tasks.py b/src/documents/tests/test_tasks.py index 46be59d53e..8160dd3f33 100644 --- a/src/documents/tests/test_tasks.py +++ b/src/documents/tests/test_tasks.py @@ -229,6 +229,26 @@ class TestTasks(DirectoriesMixin, TestCase): pages = tasks.scan_file_for_separating_barcodes(test_file) self.assertEqual(pages, [1]) + def test_scan_file_for_separating_barcodes4(self): + test_file = os.path.join( + os.path.dirname(__file__), + "samples", + "barcodes", + "several-patcht-codes.pdf", + ) + pages = tasks.scan_file_for_separating_barcodes(test_file) + self.assertEqual(pages, [2, 5]) + + def test_scan_file_for_separating_barcodes_upsidedown(self): + test_file = os.path.join( + os.path.dirname(__file__), + "samples", + "barcodes", + "patch-code-t-middle_reverse.pdf", + ) + pages = tasks.scan_file_for_separating_barcodes(test_file) + self.assertEqual(pages, [1]) + def test_scan_file_for_separating_qr_barcodes(self): test_file = os.path.join( os.path.dirname(__file__),