pytest-clerk 1.0.0__py3-none-any.whl → 1.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 +35 -2
- {pytest_clerk-1.0.0.dist-info → pytest_clerk-1.1.0.dist-info}/METADATA +1 -1
- pytest_clerk-1.1.0.dist-info/RECORD +7 -0
- pytest_clerk-1.0.0.dist-info/RECORD +0 -7
- {pytest_clerk-1.0.0.dist-info → pytest_clerk-1.1.0.dist-info}/LICENSE +0 -0
- {pytest_clerk-1.0.0.dist-info → pytest_clerk-1.1.0.dist-info}/WHEEL +0 -0
- {pytest_clerk-1.0.0.dist-info → pytest_clerk-1.1.0.dist-info}/entry_points.txt +0 -0
pytest_clerk/clerk.py
CHANGED
|
@@ -105,7 +105,7 @@ def clerk_frontend_httpx_client(clerk_frontend_api_url):
|
|
|
105
105
|
|
|
106
106
|
client = httpx.Client(
|
|
107
107
|
params={"__dev_session": result.json()["token"]},
|
|
108
|
-
base_url=clerk_frontend_api_url,
|
|
108
|
+
base_url=f"{clerk_frontend_api_url}/v1",
|
|
109
109
|
)
|
|
110
110
|
|
|
111
111
|
yield client
|
|
@@ -183,6 +183,39 @@ def clerk_create_org(clerk_backend_httpx_client, clerk_delete_org):
|
|
|
183
183
|
clerk_delete_org(org_id=org["id"])
|
|
184
184
|
|
|
185
185
|
|
|
186
|
+
@pytest.fixture
|
|
187
|
+
def clerk_update_org(clerk_backend_httpx_client):
|
|
188
|
+
"""This fixture provides a function to update an organization with the provided
|
|
189
|
+
`organization_data`. All additional kwargs are passed through to the
|
|
190
|
+
httpx.Client.patch call.
|
|
191
|
+
|
|
192
|
+
The API documentation for this call can be found below:
|
|
193
|
+
https://clerk.com/docs/reference/backend-api/tag/Organizations#operation/UpdateOrganization
|
|
194
|
+
"""
|
|
195
|
+
|
|
196
|
+
@retry(
|
|
197
|
+
retry=retry_if_exception(predicate=retry_predicate),
|
|
198
|
+
wait=wait_random_exponential(multiplier=0.5, max=60),
|
|
199
|
+
)
|
|
200
|
+
def _inner(org_id_or_slug, organization_data, **kwargs):
|
|
201
|
+
"""This function attempts to update an organization with the provided
|
|
202
|
+
`organization_data`. All additional kwargs are passed through to the
|
|
203
|
+
httpx.Client.patch call.
|
|
204
|
+
|
|
205
|
+
This will retry rate limit errors.
|
|
206
|
+
|
|
207
|
+
The API documentation for this call can be found below:
|
|
208
|
+
https://clerk.com/docs/reference/backend-api/tag/Organizations#operation/UpdateOrganization
|
|
209
|
+
"""
|
|
210
|
+
result = clerk_backend_httpx_client.patch(
|
|
211
|
+
url=f"/organizations/{org_id_or_slug}", json=organization_data, **kwargs
|
|
212
|
+
)
|
|
213
|
+
result.raise_for_status()
|
|
214
|
+
return result.json()
|
|
215
|
+
|
|
216
|
+
yield _inner
|
|
217
|
+
|
|
218
|
+
|
|
186
219
|
@pytest.fixture
|
|
187
220
|
def clerk_get_org(clerk_backend_httpx_client):
|
|
188
221
|
"""This fixture provides a function to get an organization by its ID or slug. All
|
|
@@ -364,7 +397,7 @@ def clerk_touch_user_session(clerk_frontend_httpx_client):
|
|
|
364
397
|
retry=retry_if_exception(predicate=retry_predicate),
|
|
365
398
|
wait=wait_random_exponential(multiplier=0.5, max=60),
|
|
366
399
|
)
|
|
367
|
-
def _inner(session_id, session_data, **kwargs):
|
|
400
|
+
def _inner(session_id, session_data=None, **kwargs):
|
|
368
401
|
"""Given a Clerk user session ID and any optional session_data, touch the
|
|
369
402
|
session with the given ID with any session_data sent as form data. This passes
|
|
370
403
|
through any additional kwargs to the httpx.Client.post call.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
pytest_clerk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
pytest_clerk/clerk.py,sha256=HPdH2Xr2Xany8rkbo8g2h9s-fia6K960AXnOV1J8ZWI,17462
|
|
3
|
+
pytest_clerk-1.1.0.dist-info/LICENSE,sha256=QLSYHsNt-ZLbbVtDs7h8o8v-V0SlK2BuGe7LmoPOasU,1064
|
|
4
|
+
pytest_clerk-1.1.0.dist-info/METADATA,sha256=vK9LQAaobAI6tTkydjbNwRixldraJWFzkMPKtxUsmm8,1630
|
|
5
|
+
pytest_clerk-1.1.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
6
|
+
pytest_clerk-1.1.0.dist-info/entry_points.txt,sha256=ps5MgIGlDiWP4lufTAzoQhfwL-GA7rJquc1bqnVR-oA,44
|
|
7
|
+
pytest_clerk-1.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=seb4UDkt7AAp5NkWh1NRNXzx9OpItTRVz36U6eBqRXY,16191
|
|
3
|
-
pytest_clerk-1.0.0.dist-info/LICENSE,sha256=QLSYHsNt-ZLbbVtDs7h8o8v-V0SlK2BuGe7LmoPOasU,1064
|
|
4
|
-
pytest_clerk-1.0.0.dist-info/METADATA,sha256=qynx4FXybXhk-YszbEGcYoRMfJpOaDtL0KXnhAkXbHo,1630
|
|
5
|
-
pytest_clerk-1.0.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
6
|
-
pytest_clerk-1.0.0.dist-info/entry_points.txt,sha256=ps5MgIGlDiWP4lufTAzoQhfwL-GA7rJquc1bqnVR-oA,44
|
|
7
|
-
pytest_clerk-1.0.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|