diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d37189f8..4e82b30e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,5 +47,7 @@ jobs: pip install -e .[test] - name: Testing the code with pytest + env: + MINDEE_API_KEY: ${{ secrets.MINDEE_API_KEY_SE_TESTS }} run: | pytest diff --git a/tests/product/barcode_reader/test_barcode_reader_v1_non_regression.py b/tests/product/barcode_reader/test_barcode_reader_v1_non_regression.py index 77f0a659..7e6b7f2a 100644 --- a/tests/product/barcode_reader/test_barcode_reader_v1_non_regression.py +++ b/tests/product/barcode_reader/test_barcode_reader_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product import BarcodeReaderV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/cropper/test_cropper_v1_non_regression.py b/tests/product/cropper/test_cropper_v1_non_regression.py index c3c5ba42..cdb82fd8 100644 --- a/tests/product/cropper/test_cropper_v1_non_regression.py +++ b/tests/product/cropper/test_cropper_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product import CropperV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/eu/license_plate/test_license_plate_v1_non_regression.py b/tests/product/eu/license_plate/test_license_plate_v1_non_regression.py index 70fff797..e20053bd 100644 --- a/tests/product/eu/license_plate/test_license_plate_v1_non_regression.py +++ b/tests/product/eu/license_plate/test_license_plate_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.eu import LicensePlateV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/financial_document/test_financial_document_v1_non_regression.py b/tests/product/financial_document/test_financial_document_v1_non_regression.py index 09480a26..d03fa7b6 100644 --- a/tests/product/financial_document/test_financial_document_v1_non_regression.py +++ b/tests/product/financial_document/test_financial_document_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product import FinancialDocumentV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/fr/bank_account_details/test_bank_account_details_v1_non_regression.py b/tests/product/fr/bank_account_details/test_bank_account_details_v1_non_regression.py index fa057ab3..55a7c1e5 100644 --- a/tests/product/fr/bank_account_details/test_bank_account_details_v1_non_regression.py +++ b/tests/product/fr/bank_account_details/test_bank_account_details_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.fr import BankAccountDetailsV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version @@ -7,7 +6,10 @@ def test_default_sample(): client = Client() with open( - PRODUCT_DATA_DIR / "bank_account_details" / "response_v1" / "default_sample.rst", + PRODUCT_DATA_DIR + / "bank_account_details" + / "response_v1" + / "default_sample.rst", encoding="utf-8", ) as rst_file: rst_ref = rst_file.read() diff --git a/tests/product/fr/bank_account_details/test_bank_account_details_v2_non_regression.py b/tests/product/fr/bank_account_details/test_bank_account_details_v2_non_regression.py index 5e9f115b..d262572b 100644 --- a/tests/product/fr/bank_account_details/test_bank_account_details_v2_non_regression.py +++ b/tests/product/fr/bank_account_details/test_bank_account_details_v2_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.fr import BankAccountDetailsV2 from tests.product import PRODUCT_DATA_DIR, get_id, get_version @@ -7,7 +6,10 @@ def test_default_sample(): client = Client() with open( - PRODUCT_DATA_DIR / "bank_account_details" / "response_v2" / "default_sample.rst", + PRODUCT_DATA_DIR + / "bank_account_details" + / "response_v2" + / "default_sample.rst", encoding="utf-8", ) as rst_file: rst_ref = rst_file.read() diff --git a/tests/product/fr/carte_grise/test_carte_grise_v1_non_regression.py b/tests/product/fr/carte_grise/test_carte_grise_v1_non_regression.py index 549e1fa6..5ccfcdf7 100644 --- a/tests/product/fr/carte_grise/test_carte_grise_v1_non_regression.py +++ b/tests/product/fr/carte_grise/test_carte_grise_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.fr import CarteGriseV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/fr/carte_vitale/test_carte_vitale_v1_non_regression.py b/tests/product/fr/carte_vitale/test_carte_vitale_v1_non_regression.py index bf84962b..667b63d0 100644 --- a/tests/product/fr/carte_vitale/test_carte_vitale_v1_non_regression.py +++ b/tests/product/fr/carte_vitale/test_carte_vitale_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.fr import CarteVitaleV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/fr/id_card/test_id_card_v1_non_regression.py b/tests/product/fr/id_card/test_id_card_v1_non_regression.py index 88bb8ebc..32b354ed 100644 --- a/tests/product/fr/id_card/test_id_card_v1_non_regression.py +++ b/tests/product/fr/id_card/test_id_card_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.fr import IdCardV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/fr/id_card/test_id_card_v2_non_regression.py b/tests/product/fr/id_card/test_id_card_v2_non_regression.py index 12ca052d..88fb7246 100644 --- a/tests/product/fr/id_card/test_id_card_v2_non_regression.py +++ b/tests/product/fr/id_card/test_id_card_v2_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.fr import IdCardV2 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/fr/petrol_receipt/test_petrol_receipt_v1_non_regression.py b/tests/product/fr/petrol_receipt/test_petrol_receipt_v1_non_regression.py index 9d50aecd..051f1958 100644 --- a/tests/product/fr/petrol_receipt/test_petrol_receipt_v1_non_regression.py +++ b/tests/product/fr/petrol_receipt/test_petrol_receipt_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.fr import PetrolReceiptV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/invoice/test_invoice_v4_non_regression.py b/tests/product/invoice/test_invoice_v4_non_regression.py index 4529db2b..613b21ac 100644 --- a/tests/product/invoice/test_invoice_v4_non_regression.py +++ b/tests/product/invoice/test_invoice_v4_non_regression.py @@ -1,12 +1,11 @@ from mindee.client import Client - from mindee.product import InvoiceV4 from tests.product import PRODUCT_DATA_DIR, get_id, get_version def test_default_sample(): client = Client() - + with open( PRODUCT_DATA_DIR / "invoices" / "response_v4" / "default_sample.rst", encoding="utf-8", @@ -16,7 +15,7 @@ def test_default_sample(): sample = client.source_from_path( PRODUCT_DATA_DIR / "invoices" / "default_sample.jpg" ) - + response = client.parse(InvoiceV4, sample) doc_response = response.document doc_response.id = get_id(rst_ref) diff --git a/tests/product/invoice_splitter/test_invoice_splitter_v1_non_regression.py b/tests/product/invoice_splitter/test_invoice_splitter_v1_non_regression.py index 492b433d..5317b4d7 100644 --- a/tests/product/invoice_splitter/test_invoice_splitter_v1_non_regression.py +++ b/tests/product/invoice_splitter/test_invoice_splitter_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product import InvoiceSplitterV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version @@ -11,11 +10,11 @@ def test_default_sample(): encoding="utf-8", ) as rst_file: rst_ref = rst_file.read() - + sample = client.source_from_path( PRODUCT_DATA_DIR / "invoice_splitter" / "default_sample.pdf" ) - + response = client.enqueue_and_parse(InvoiceSplitterV1, sample) doc_response = response.document doc_response.id = get_id(rst_ref) diff --git a/tests/product/multi_receipts_detector/test_multi_receipts_detector_v1_non_regression.py b/tests/product/multi_receipts_detector/test_multi_receipts_detector_v1_non_regression.py index 24733abb..f9e78b27 100644 --- a/tests/product/multi_receipts_detector/test_multi_receipts_detector_v1_non_regression.py +++ b/tests/product/multi_receipts_detector/test_multi_receipts_detector_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product import MultiReceiptsDetectorV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version @@ -7,7 +6,10 @@ def test_default_sample(): client = Client() with open( - PRODUCT_DATA_DIR / "multi_receipts_detector" / "response_v1" / "default_sample.rst", + PRODUCT_DATA_DIR + / "multi_receipts_detector" + / "response_v1" + / "default_sample.rst", encoding="utf-8", ) as rst_file: rst_ref = rst_file.read() diff --git a/tests/product/passport/test_passport_v1_non_regression.py b/tests/product/passport/test_passport_v1_non_regression.py index 8b16930c..aa7c168e 100644 --- a/tests/product/passport/test_passport_v1_non_regression.py +++ b/tests/product/passport/test_passport_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product import PassportV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/proof_of_address/test_proof_of_address_v1_non_regression.py b/tests/product/proof_of_address/test_proof_of_address_v1_non_regression.py index 65828866..8ff16447 100644 --- a/tests/product/proof_of_address/test_proof_of_address_v1_non_regression.py +++ b/tests/product/proof_of_address/test_proof_of_address_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product import ProofOfAddressV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/receipt/test_receipt_v4_non_regression.py b/tests/product/receipt/test_receipt_v4_non_regression.py index 26c2fcfe..48cdeea2 100644 --- a/tests/product/receipt/test_receipt_v4_non_regression.py +++ b/tests/product/receipt/test_receipt_v4_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product import ReceiptV4 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/receipt/test_receipt_v5_non_regression.py b/tests/product/receipt/test_receipt_v5_non_regression.py index d9e3ab7e..caa91505 100644 --- a/tests/product/receipt/test_receipt_v5_non_regression.py +++ b/tests/product/receipt/test_receipt_v5_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product import ReceiptV5 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/us/bank_check/test_banck_check_v1_non_regression.py b/tests/product/us/bank_check/test_banck_check_v1_non_regression.py index 42ae8c2d..c96b2c23 100644 --- a/tests/product/us/bank_check/test_banck_check_v1_non_regression.py +++ b/tests/product/us/bank_check/test_banck_check_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.us import BankCheckV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/us/driver_license/test_driver_license_v1_non_regression.py b/tests/product/us/driver_license/test_driver_license_v1_non_regression.py index 39ab00c8..3f3a7735 100644 --- a/tests/product/us/driver_license/test_driver_license_v1_non_regression.py +++ b/tests/product/us/driver_license/test_driver_license_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.us import DriverLicenseV1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version diff --git a/tests/product/us/w9/test_w9_v1_non_regression.py b/tests/product/us/w9/test_w9_v1_non_regression.py index 6263bd08..49fb62dd 100644 --- a/tests/product/us/w9/test_w9_v1_non_regression.py +++ b/tests/product/us/w9/test_w9_v1_non_regression.py @@ -1,5 +1,4 @@ from mindee.client import Client - from mindee.product.us import W9V1 from tests.product import PRODUCT_DATA_DIR, get_id, get_version @@ -12,9 +11,7 @@ def test_default_sample(): ) as rst_file: rst_ref = rst_file.read() - sample = client.source_from_path( - PRODUCT_DATA_DIR / "us_w9" / "default_sample.jpg" - ) + sample = client.source_from_path(PRODUCT_DATA_DIR / "us_w9" / "default_sample.jpg") response = client.parse(W9V1, sample) doc_response = response.document doc_response.id = get_id(rst_ref)