File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,10 @@ def test_auto_generates_idempotency_key(
126126 assert "idempotency-key" in request_kwargs ["headers" ]
127127 idempotency_key = request_kwargs ["headers" ]["idempotency-key" ]
128128 assert idempotency_key and idempotency_key .strip ()
129+ # Assert the auto-generated key has the correct prefix
130+ assert idempotency_key .startswith ("workos-python-" )
131+ # Assert the key has the expected UUID format after the prefix
132+ assert len (idempotency_key ) > len ("workos-python-" )
129133 assert response is None
130134
131135 def test_throws_unauthorized_exception (
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ def create_event(
8686 headers = {}
8787 # Auto-generate UUID v4 if not provided
8888 if idempotency_key is None :
89- idempotency_key = str ( uuid .uuid4 ())
89+ idempotency_key = f"workos-python- { uuid .uuid4 ()} "
9090
9191 headers ["idempotency-key" ] = idempotency_key
9292
You can’t perform that action at this time.
0 commit comments