25 lines
840 B
Python
25 lines
840 B
Python
|
import sys
|
||
|
sys.path.append(".")
|
||
|
from tests.utils import login, make_sbt_request
|
||
|
import os
|
||
|
import json
|
||
|
import deepdiff
|
||
|
|
||
|
HOST = os.environ.get("IDP_HOST", "XXXXXXXXXXXXXXXXXXXXX")
|
||
|
USERNAME = os.environ.get("IDP_USERNAME", "XXXXXXXXXXXXXXXXXXXXX")
|
||
|
PASSWORD = os.environ.get("IDP_PASSWORD", "XXXXXXXXXXXXXXXXXXXXX")
|
||
|
token = login(HOST, USERNAME, PASSWORD)
|
||
|
|
||
|
|
||
|
def test_invoice_number():
|
||
|
invoice_files = []
|
||
|
imei_files = [
|
||
|
"test_samples/test_26/invoice_no_jpg.jpg",
|
||
|
]
|
||
|
data = make_sbt_request(host=HOST, token=token, invoice_files=invoice_files, imei_files=imei_files, ensure_success=False)
|
||
|
document = data["data"]["data"]["document"][0]
|
||
|
gt = json.load(open("test_samples/test_26/result.json", "r"))
|
||
|
diff = deepdiff.DeepDiff(document, gt)
|
||
|
|
||
|
assert diff == {}, f"Different result! GT: {gt}; RESULT: {document}"
|