pytest-clerk 2.0.0__py3-none-any.whl → 2.1.0__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 CHANGED
@@ -476,3 +476,34 @@ def clerk_get_user_session_token(clerk_frontend_httpx_client):
476
476
  return result.json()["jwt"]
477
477
 
478
478
  return _inner
479
+
480
+
481
+ @pytest.fixture
482
+ def clerk_end_user_session(clerk_frontend_httpx_client):
483
+ """This fixture returns a function that, given a Clerk user session ID, ends that
484
+ session. This passes through any additional kwargs to the httpx.Client.post call.
485
+
486
+ The API documentation for this call can be found below:
487
+ https://clerk.com/docs/reference/frontend-api/tag/Sessions#operation/endSession
488
+ """
489
+
490
+ @retry(
491
+ retry=retry_if_exception(predicate=retry_predicate),
492
+ wait=wait_random_exponential(multiplier=0.5, max=60),
493
+ )
494
+ def _inner(session_id, **kwargs):
495
+ """Given a Clerk user session ID, ends that session. This passes through any
496
+ additional kwargs to the httpx.Client.post call.
497
+
498
+ This will retry rate limit errors.
499
+
500
+ The API documentation for this call can be found below:
501
+ https://clerk.com/docs/reference/frontend-api/tag/Sessions#operation/endSession
502
+ """
503
+ result = clerk_frontend_httpx_client.post(
504
+ url=f"/client/sessions/{session_id}/end", **kwargs
505
+ )
506
+ result.raise_for_status()
507
+ return result.json()
508
+
509
+ return _inner
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytest-clerk
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: A set of pytest fixtures to help with integration testing with Clerk.
5
5
  Home-page: https://gitlab.com/munipal-oss/pytest-clerk
6
6
  License: MIT
@@ -0,0 +1,7 @@
1
+ pytest_clerk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ pytest_clerk/clerk.py,sha256=TOTk9lNy-AL6bi4r0DFIo4-dkH0GJtzkY_OSd0Ly2KQ,18599
3
+ pytest_clerk-2.1.0.dist-info/LICENSE,sha256=QLSYHsNt-ZLbbVtDs7h8o8v-V0SlK2BuGe7LmoPOasU,1064
4
+ pytest_clerk-2.1.0.dist-info/METADATA,sha256=GBpAjAxXFKFRMyNeKeU96e4_JC-ByBTO3a08tx6Qeu8,1631
5
+ pytest_clerk-2.1.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
6
+ pytest_clerk-2.1.0.dist-info/entry_points.txt,sha256=ps5MgIGlDiWP4lufTAzoQhfwL-GA7rJquc1bqnVR-oA,44
7
+ pytest_clerk-2.1.0.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- pytest_clerk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- pytest_clerk/clerk.py,sha256=HPdH2Xr2Xany8rkbo8g2h9s-fia6K960AXnOV1J8ZWI,17462
3
- pytest_clerk-2.0.0.dist-info/LICENSE,sha256=QLSYHsNt-ZLbbVtDs7h8o8v-V0SlK2BuGe7LmoPOasU,1064
4
- pytest_clerk-2.0.0.dist-info/METADATA,sha256=WFi4sGrY2GUdJuMyzeH79QC4-ZVpSLU6RjCwF8qRteY,1631
5
- pytest_clerk-2.0.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
6
- pytest_clerk-2.0.0.dist-info/entry_points.txt,sha256=ps5MgIGlDiWP4lufTAzoQhfwL-GA7rJquc1bqnVR-oA,44
7
- pytest_clerk-2.0.0.dist-info/RECORD,,