Skip to content
This repository was archived by the owner on Apr 26, 2025. It is now read-only.

Commit bc371f4

Browse files
committed
Fix email_verify request method
1 parent de66076 commit bc371f4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

fief_client/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def _get_email_verify_request(
422422
code: str,
423423
) -> httpx.Request:
424424
return client.build_request(
425-
"PATCH",
425+
"POST",
426426
endpoint,
427427
headers={"Authorization": f"Bearer {access_token}"},
428428
json={"code": code},

tests/test_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ def test_error_response(
651651
fief_client: Fief,
652652
mock_api_requests: respx.MockRouter,
653653
):
654-
route = mock_api_requests.patch(endpoint)
654+
route = mock_api_requests.route(path=endpoint)
655655
route.return_value = Response(400, json={"detail": "error"})
656656

657657
with pytest.raises(FiefRequestError) as excinfo:
@@ -669,7 +669,7 @@ def test_valid_response(
669669
mock_api_requests: respx.MockRouter,
670670
user_id: str,
671671
):
672-
mock_api_requests.patch(endpoint).return_value = Response(
672+
mock_api_requests.route(path=endpoint).return_value = Response(
673673
200, json={"sub": user_id}
674674
)
675675

@@ -686,7 +686,7 @@ async def test_error_response_async(
686686
fief_async_client: FiefAsync,
687687
mock_api_requests: respx.MockRouter,
688688
):
689-
route = mock_api_requests.patch(endpoint)
689+
route = mock_api_requests.route(path=endpoint)
690690
route.return_value = Response(400, json={"detail": "error"})
691691

692692
with pytest.raises(FiefRequestError) as excinfo:
@@ -705,7 +705,7 @@ async def test_valid_response_async(
705705
mock_api_requests: respx.MockRouter,
706706
user_id: str,
707707
):
708-
mock_api_requests.patch(endpoint).return_value = Response(
708+
mock_api_requests.route(path=endpoint).return_value = Response(
709709
200, json={"sub": user_id}
710710
)
711711

0 commit comments

Comments
 (0)