Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/test_payment_request_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ def test_valid_find_all_payment_requests_request_with_options(httpx_mock: HTTPXM
assert response["meta"]["current_page"] == 1


def test_valid_find_all_payment_requests_request_with_currency(httpx_mock: HTTPXMock):
client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")

httpx_mock.add_response(
method="GET",
url="https://api.getlago.com/api/v1/payment_requests?currency=EUR",
content=mock_collection_response(),
)
response = client.payment_requests.find_all({"currency": "EUR"})

assert response["payment_requests"][0].lago_id == "89b6b61e-4dbc-4307-ac96-4abcfa9e3e2d"
assert response["meta"]["current_page"] == 1


def test_invalid_find_all_payment_requests_request(httpx_mock: HTTPXMock):
client = Client(api_key="invalid")

Expand Down
14 changes: 14 additions & 0 deletions tests/test_subscription_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,20 @@ def test_valid_find_all_subscription_request_with_options(httpx_mock: HTTPXMock)
assert response["meta"]["current_page"] == 1


def test_valid_find_all_subscription_request_with_currency(httpx_mock: HTTPXMock):
client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")

httpx_mock.add_response(
method="GET",
url="https://api.getlago.com/api/v1/subscriptions?currency=EUR",
content=mock_collection_response(),
)
response = client.subscriptions.find_all({"currency": "EUR"})

assert response["subscriptions"][0].lago_id == "b7ab2926-1de8-4428-9bcd-779314ac129b"
assert response["meta"]["current_page"] == 1


def test_invalid_find_all_subscription_request(httpx_mock: HTTPXMock):
client = Client(api_key="invalid")

Expand Down
14 changes: 14 additions & 0 deletions tests/test_wallet_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,20 @@ def test_valid_find_all_wallet_request_with_options(httpx_mock: HTTPXMock):
assert response["meta"]["current_page"] == 1


def test_valid_find_all_wallet_request_with_currency(httpx_mock: HTTPXMock):
client = Client(api_key="886fe239-927d-4072-ab72-6dd345e8dd0d")

httpx_mock.add_response(
method="GET",
url="https://api.getlago.com/api/v1/wallets?currency=EUR",
content=mock_collection_response(),
)
response = client.wallets.find_all({"currency": "EUR"})

assert response["wallets"][0].lago_id == "b7ab2926-1de8-4428-9bcd-779314ac129b"
assert response["meta"]["current_page"] == 1


def test_invalid_find_all_wallet_request(httpx_mock: HTTPXMock):
client = Client(api_key="invalid")

Expand Down
Loading