Skip to content
Closed
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1e3e7ef
stuff
swaroopAkkineniWorkos Nov 10, 2025
7823022
retry
swaroopAkkineniWorkos Nov 10, 2025
e3a12d7
more cleanup
swaroopAkkineniWorkos Nov 10, 2025
9d2dae2
moar cleanup
swaroopAkkineniWorkos Nov 11, 2025
311d4ca
moar tests
swaroopAkkineniWorkos Nov 11, 2025
922ffe7
stuff
swaroopAkkineniWorkos Nov 11, 2025
35a2706
cleanup
swaroopAkkineniWorkos Nov 11, 2025
5611ce7
stuff
swaroopAkkineniWorkos Nov 11, 2025
145d24c
lol
swaroopAkkineniWorkos Nov 11, 2025
a8854b5
lol
swaroopAkkineniWorkos Nov 11, 2025
8fd6a5d
moar
swaroopAkkineniWorkos Nov 11, 2025
53a706b
Refactor retry logic method naming for clarity
swaroopAkkineniWorkos Nov 11, 2025
479ced1
Fix Black formatting for HTTP client retry implementation
swaroopAkkineniWorkos Nov 11, 2025
2bb414f
Align async retry tests with sync test suite
swaroopAkkineniWorkos Nov 11, 2025
b1695ec
Apply black formatting to test_http_client_retry.py
swaroopAkkineniWorkos Nov 11, 2025
81bab32
remove
swaroopAkkineniWorkos Nov 11, 2025
7aa9142
remove
swaroopAkkineniWorkos Nov 11, 2025
c647324
moar
swaroopAkkineniWorkos Nov 13, 2025
adfcb80
cleanup
swaroopAkkineniWorkos Nov 17, 2025
6df9b7a
lint
swaroopAkkineniWorkos Nov 17, 2025
b10c8f0
sup
swaroopAkkineniWorkos Nov 17, 2025
9b06353
moar tests
swaroopAkkineniWorkos Nov 17, 2025
f8745ca
moar tests
swaroopAkkineniWorkos Nov 17, 2025
99e915f
sup
swaroopAkkineniWorkos Nov 17, 2025
5f1d921
sup
swaroopAkkineniWorkos Nov 17, 2025
434fe2f
Merge main into ENT-3983-python-idempotency-retry
gjtorikian Jan 13, 2026
8c0fae0
lint
gjtorikian Jan 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions tests/test_audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,28 @@ def test_sends_idempotency_key(
assert request_kwargs["headers"]["idempotency-key"] == idempotency_key
assert response is None

def test_auto_generates_idempotency_key(
self, mock_audit_log_event, capture_and_mock_http_client_request
):
"""Test that idempotency key is auto-generated when not provided."""
organization_id = "org_123456789"

request_kwargs = capture_and_mock_http_client_request(
self.http_client, {"success": True}, 200
)

response = self.audit_logs.create_event(
organization_id=organization_id,
event=mock_audit_log_event,
# No idempotency_key provided
)

# Assert header exists and has a non-empty value
assert "idempotency-key" in request_kwargs["headers"]
idempotency_key = request_kwargs["headers"]["idempotency-key"]
assert idempotency_key and idempotency_key.strip()
assert response is None

def test_throws_unauthorized_exception(
self, mock_audit_log_event, mock_http_client_with_response
):
Expand Down
Loading