diff options
Diffstat (limited to '')
-rw-r--r-- | pyblackbird_cc/resources/tests/test_file_processing.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pyblackbird_cc/resources/tests/test_file_processing.py b/pyblackbird_cc/resources/tests/test_file_processing.py index 40cc5eb..cbb4972 100644 --- a/pyblackbird_cc/resources/tests/test_file_processing.py +++ b/pyblackbird_cc/resources/tests/test_file_processing.py @@ -5,6 +5,8 @@ from django.core.files.uploadedfile import TemporaryUploadedFile from django.test import TestCase from django.urls import reverse +from pyblackbird_cc.resources.views import _get_pdf_collection_type + from .. import services """ Explanation: @@ -36,6 +38,18 @@ We also test the integrity of the uploaded PDF file here by checking the number """ +def test_detect_snapshotted_pdf_collection(): + single_pdf_single_page = [["toss"]] + single_pdf_multi_page = [["toss2", "toss8"]] + multi_pdf_single_page = [["toss"], ["toss2"]] + multi_pdf_multi_page = [["toss", "toss2"], ["toss", "toss2"]] + + assert _get_pdf_collection_type(single_pdf_single_page) == "SINGLE_PDF_SINGLE_PAGE" + assert _get_pdf_collection_type(single_pdf_multi_page) == "SINGLE_PDF_MULTI_PAGE" + assert _get_pdf_collection_type(multi_pdf_single_page) == "MULTI_PDF_SINGLE_PAGE" + assert _get_pdf_collection_type(multi_pdf_multi_page) == "MULTI_PDF_MULTI_PAGE" + + class PDFFileUploadTestCase(TestCase): def setUp(self): self.url = reverse("resources:create_resource") |