-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_invoice_attachments.py
More file actions
51 lines (34 loc) · 1.46 KB
/
test_invoice_attachments.py
File metadata and controls
51 lines (34 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import pytest
from mpt_api_client.resources.billing.invoice_attachments import (
AsyncInvoiceAttachmentsService,
InvoiceAttachmentsService,
)
@pytest.fixture
def invoice_attachments_service(http_client):
return InvoiceAttachmentsService(
http_client=http_client, endpoint_params={"invoice_id": "INV-0000-0001"}
)
@pytest.fixture
def async_invoice_attachments_service(async_http_client):
return AsyncInvoiceAttachmentsService(
http_client=async_http_client, endpoint_params={"invoice_id": "INV-0000-0001"}
)
def test_endpoint(invoice_attachments_service):
result = (
invoice_attachments_service.path == "/public/v1/billing/invoices/INV-0000-0001/attachments"
)
assert result is True
def test_async_endpoint(async_invoice_attachments_service):
result = (
async_invoice_attachments_service.path
== "/public/v1/billing/invoices/INV-0000-0001/attachments"
)
assert result is True
@pytest.mark.parametrize("method", ["get", "create", "update", "delete", "iterate", "download"])
def test_methods_present(invoice_attachments_service, method: str):
result = hasattr(invoice_attachments_service, method)
assert result is True
@pytest.mark.parametrize("method", ["get", "create", "update", "delete", "iterate", "download"])
def test_async_methods_present(async_invoice_attachments_service, method: str):
result = hasattr(async_invoice_attachments_service, method)
assert result is True