Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianMindee committed Oct 20, 2023
1 parent b04be2f commit 7929dee
Show file tree
Hide file tree
Showing 22 changed files with 19 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/product/cropper/test_cropper_v1_non_regression.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from mindee.client import Client

from mindee.product.fr import BankAccountDetailsV1
from tests.product import PRODUCT_DATA_DIR, get_id, get_version


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()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from mindee.client import Client

from mindee.product.fr import BankAccountDetailsV2
from tests.product import PRODUCT_DATA_DIR, get_id, get_version


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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/product/fr/id_card/test_id_card_v1_non_regression.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/product/fr/id_card/test_id_card_v2_non_regression.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 2 additions & 3 deletions tests/product/invoice/test_invoice_v4_non_regression.py
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
from mindee.client import Client

from mindee.product import MultiReceiptsDetectorV1
from tests.product import PRODUCT_DATA_DIR, get_id, get_version


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()
Expand Down
1 change: 0 additions & 1 deletion tests/product/passport/test_passport_v1_non_regression.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/product/receipt/test_receipt_v4_non_regression.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion tests/product/receipt/test_receipt_v5_non_regression.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 1 addition & 4 deletions tests/product/us/w9/test_w9_v1_non_regression.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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)
Expand Down

0 comments on commit 7929dee

Please sign in to comment.