-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_journal_attachments.py
More file actions
51 lines (34 loc) · 1.55 KB
/
test_journal_attachments.py
File metadata and controls
51 lines (34 loc) · 1.55 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.journal_attachments import (
AsyncJournalAttachmentsService,
JournalAttachmentsService,
)
@pytest.fixture
def journal_attachments_service(http_client) -> JournalAttachmentsService:
return JournalAttachmentsService(
http_client=http_client, endpoint_params={"journal_id": "JRN-0000-0001"}
)
@pytest.fixture
def async_journal_attachments_service(async_http_client) -> AsyncJournalAttachmentsService:
return AsyncJournalAttachmentsService(
http_client=async_http_client, endpoint_params={"journal_id": "JRN-0000-0001"}
)
def test_endpoint(journal_attachments_service) -> None:
result = (
journal_attachments_service.path == "/public/v1/billing/journals/JRN-0000-0001/attachments"
)
assert result is True
def test_async_endpoint(async_journal_attachments_service) -> None:
result = (
async_journal_attachments_service.path
== "/public/v1/billing/journals/JRN-0000-0001/attachments"
)
assert result is True
@pytest.mark.parametrize("method", ["get", "create", "update", "delete", "iterate", "download"])
def test_methods_present(journal_attachments_service, method: str) -> None:
result = hasattr(journal_attachments_service, method)
assert result is True
@pytest.mark.parametrize("method", ["get", "create", "update", "delete", "iterate", "download"])
def test_async_methods_present(async_journal_attachments_service, method: str) -> None:
result = hasattr(async_journal_attachments_service, method)
assert result is True