diff --git a/tests/test_payment_request_client.py b/tests/test_payment_request_client.py index 5f065dc..aefcd9b 100644 --- a/tests/test_payment_request_client.py +++ b/tests/test_payment_request_client.py @@ -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") diff --git a/tests/test_subscription_client.py b/tests/test_subscription_client.py index fbb5d71..3e568d3 100644 --- a/tests/test_subscription_client.py +++ b/tests/test_subscription_client.py @@ -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") diff --git a/tests/test_wallet_client.py b/tests/test_wallet_client.py index b3f55b8..24746e8 100644 --- a/tests/test_wallet_client.py +++ b/tests/test_wallet_client.py @@ -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")