]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
add more tests
authorFlorian Brandes <florian.brandes@posteo.de>
Sat, 2 Apr 2022 08:21:51 +0000 (10:21 +0200)
committerFlorian Brandes <florian.brandes@posteo.de>
Thu, 7 Apr 2022 09:14:29 +0000 (11:14 +0200)
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
src/documents/tests/samples/barcodes/patch-code-t-middle_reverse.pdf [new file with mode: 0644]
src/documents/tests/samples/barcodes/several-patcht-codes.pdf [new file with mode: 0644]
src/documents/tests/test_tasks.py

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 (file)
index 0000000..e1f8bc3
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 (file)
index 0000000..de4c715
Binary files /dev/null and b/src/documents/tests/samples/barcodes/several-patcht-codes.pdf differ
index 46be59d53ea12aef4f76aac2396e1aa979aa7370..8160dd3f3332f0d949468d1fb7d996d556417ef9 100644 (file)
@@ -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__),