sbt-idp/tests/test_set_03_big_image_sizes.py

23 lines
823 B
Python
Raw Normal View History

2023-12-26 08:58:44 +00:00
import sys
sys.path.append(".")
from tests.utils import login, make_sbt_request, get_field
import os
import logging
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_larger_than_5000x5000():
invoice_files = [
"test_samples/test_03/image_larger_than_5K.jpg"
]
imei_files = [
"test_samples/sbt/imei1.jpg"
]
data = make_sbt_request(host=HOST, token=token, invoice_files=invoice_files, imei_files=imei_files, ensure_success=False)
response_data = data["data"]
2023-12-26 10:15:30 +00:00
assert "is not valid, maximum size for one side is 5000" in str(response_data) or "Limit reached" in str(response_data)