99@pytest .fixture
1010def custom_doc (monkeypatch ):
1111 clear_envvars (monkeypatch )
12-
1312 return Namespace (
1413 product_name = "custom" ,
1514 doc_type = "license_plate" ,
@@ -25,12 +24,9 @@ def custom_doc(monkeypatch):
2524
2625
2726@pytest .fixture
28- def invoice_doc (monkeypatch ):
27+ def ots_doc (monkeypatch ):
2928 clear_envvars (monkeypatch )
30-
3129 return Namespace (
32- product_name = "invoice" ,
33- invoice_api_key = "" ,
3430 raise_on_error = True ,
3531 cut_pdf = True ,
3632 input_type = "path" ,
@@ -45,6 +41,30 @@ def test_cli_custom_doc(custom_doc):
4541 call_endpoint (custom_doc )
4642
4743
48- def test_cli_invoice_doc (invoice_doc ):
44+ def test_cli_invoice (ots_doc ):
45+ ots_doc .product_name = "invoice"
46+ ots_doc .invoice_api_key = ""
47+ with pytest .raises (RuntimeError ):
48+ call_endpoint (ots_doc )
49+
50+
51+ def test_cli_receipt (ots_doc ):
52+ ots_doc .product_name = "receipt"
53+ ots_doc .receipt_api_key = ""
54+ with pytest .raises (RuntimeError ):
55+ call_endpoint (ots_doc )
56+
57+
58+ def test_cli_financial_doc (ots_doc ):
59+ ots_doc .product_name = "financial"
60+ ots_doc .invoice_api_key = ""
61+ ots_doc .receipt_api_key = ""
62+ with pytest .raises (RuntimeError ):
63+ call_endpoint (ots_doc )
64+
65+
66+ def test_cli_passport (ots_doc ):
67+ ots_doc .product_name = "passport"
68+ ots_doc .passport_api_key = ""
4969 with pytest .raises (RuntimeError ):
50- call_endpoint (invoice_doc )
70+ call_endpoint (ots_doc )
0 commit comments