pytest-clerk 4.0.5__tar.gz → 4.1.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pytest-clerk
3
- Version: 4.0.5
3
+ Version: 4.1.0
4
4
  Summary: A set of pytest fixtures to help with integration testing with Clerk.
5
5
  License: MIT
6
6
  Author: Ryan Causey
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pytest-clerk"
3
- version = "4.0.5"
3
+ version = "4.1.0"
4
4
  description = "A set of pytest fixtures to help with integration testing with Clerk."
5
5
  license = "MIT"
6
6
  readme = "README.md"
@@ -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
File without changes
File without changes