pytest-clerk 4.0.5__py3-none-any.whl → 4.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytest_clerk/clerk.py +33 -0
- {pytest_clerk-4.0.5.dist-info → pytest_clerk-4.1.1.dist-info}/METADATA +5 -4
- pytest_clerk-4.1.1.dist-info/RECORD +7 -0
- {pytest_clerk-4.0.5.dist-info → pytest_clerk-4.1.1.dist-info}/WHEEL +1 -1
- pytest_clerk-4.0.5.dist-info/RECORD +0 -7
- {pytest_clerk-4.0.5.dist-info → pytest_clerk-4.1.1.dist-info}/entry_points.txt +0 -0
- {pytest_clerk-4.0.5.dist-info → pytest_clerk-4.1.1.dist-info/licenses}/LICENSE +0 -0
pytest_clerk/clerk.py
CHANGED
|
@@ -480,6 +480,39 @@ def clerk_create_user(clerk_backend_httpx_client, clerk_delete_user):
|
|
|
480
480
|
clerk_delete_user(user_id=user["id"])
|
|
481
481
|
|
|
482
482
|
|
|
483
|
+
@pytest.fixture
|
|
484
|
+
def clerk_update_user_metadata(clerk_backend_httpx_client):
|
|
485
|
+
"""This fixture provides a function to update a user's metadata given the user ID.
|
|
486
|
+
All additional kwargs are passed through to the httpx.Client.patch call.
|
|
487
|
+
|
|
488
|
+
The API documentation for this call can be found below:
|
|
489
|
+
https://clerk.com/docs/reference/backend-api/tag/users/patch/users/%7Buser_id%7D/metadata
|
|
490
|
+
"""
|
|
491
|
+
|
|
492
|
+
@retry(
|
|
493
|
+
stop=stop_after_attempt(10),
|
|
494
|
+
wait=wait_random_exponential(multiplier=0.5, max=60),
|
|
495
|
+
reraise=True,
|
|
496
|
+
)
|
|
497
|
+
def _inner(user_id, metadata, **kwargs):
|
|
498
|
+
"""Update the metadata of the user with the given user ID. All additional kwargs
|
|
499
|
+
are passed through to the httpx.Client.patch call.
|
|
500
|
+
|
|
501
|
+
This will retry rate limit errors.
|
|
502
|
+
|
|
503
|
+
The API documentation for this call can be found below:
|
|
504
|
+
https://clerk.com/docs/reference/backend-api/tag/users/patch/users/%7Buser_id%7D/metadata
|
|
505
|
+
"""
|
|
506
|
+
result = clerk_backend_httpx_client.patch(
|
|
507
|
+
url=f"/users/{user_id}/metadata", json=metadata, **kwargs
|
|
508
|
+
)
|
|
509
|
+
result.raise_for_status()
|
|
510
|
+
|
|
511
|
+
return result.json()
|
|
512
|
+
|
|
513
|
+
return _inner
|
|
514
|
+
|
|
515
|
+
|
|
483
516
|
@pytest.fixture
|
|
484
517
|
def clerk_add_org_member(clerk_backend_httpx_client):
|
|
485
518
|
"""This fixture provides a function to add a user to an organization. All additional
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pytest-clerk
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.1.1
|
|
4
4
|
Summary: A set of pytest fixtures to help with integration testing with Clerk.
|
|
5
|
-
License: MIT
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
6
7
|
Author: Ryan Causey
|
|
7
8
|
Author-email: ryan.causey@munipal.io
|
|
8
9
|
Requires-Python: >=3.10,<4.0
|
|
@@ -10,7 +11,7 @@ Classifier: Framework :: Pytest
|
|
|
10
11
|
Provides-Extra: aws
|
|
11
12
|
Requires-Dist: httpx (>=0.28.0,<1.0.0)
|
|
12
13
|
Requires-Dist: limits (>=4.0.1,<5.0.0)
|
|
13
|
-
Requires-Dist: pytest (>=8.0.0,<
|
|
14
|
+
Requires-Dist: pytest (>=8.0.0,<10.0.0)
|
|
14
15
|
Requires-Dist: pytest-aws-fixtures (>=3.0.0,<4.0) ; extra == "aws"
|
|
15
16
|
Requires-Dist: python-decouple (>=3.0,<4.0)
|
|
16
17
|
Requires-Dist: tenacity (>=9.0.0,<10.0.0)
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pytest_clerk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
pytest_clerk/clerk.py,sha256=0PTijwO9x5MqM7Mr5kzDonIuRFvtx4BuX8LThwUOP2c,26196
|
|
3
|
+
pytest_clerk-4.1.1.dist-info/METADATA,sha256=AJgYVDHPB8Tey1DS2LI5ry54lLShSWs6VzaUeAAIWbo,1325
|
|
4
|
+
pytest_clerk-4.1.1.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
5
|
+
pytest_clerk-4.1.1.dist-info/entry_points.txt,sha256=ps5MgIGlDiWP4lufTAzoQhfwL-GA7rJquc1bqnVR-oA,44
|
|
6
|
+
pytest_clerk-4.1.1.dist-info/licenses/LICENSE,sha256=QLSYHsNt-ZLbbVtDs7h8o8v-V0SlK2BuGe7LmoPOasU,1064
|
|
7
|
+
pytest_clerk-4.1.1.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
pytest_clerk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
pytest_clerk/clerk.py,sha256=Pi0VoViVhKrW3KJDixIH6DdiUMRokhmTEHO1LZOdE7Y,25025
|
|
3
|
-
pytest_clerk-4.0.5.dist-info/LICENSE,sha256=QLSYHsNt-ZLbbVtDs7h8o8v-V0SlK2BuGe7LmoPOasU,1064
|
|
4
|
-
pytest_clerk-4.0.5.dist-info/METADATA,sha256=qCepHtA_60_Kg0_rZxyJ9wcSK5AxqCJXV9H2z3Ko2WE,1291
|
|
5
|
-
pytest_clerk-4.0.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
6
|
-
pytest_clerk-4.0.5.dist-info/entry_points.txt,sha256=ps5MgIGlDiWP4lufTAzoQhfwL-GA7rJquc1bqnVR-oA,44
|
|
7
|
-
pytest_clerk-4.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|