Skip to content

Commit 76de37c

Browse files
committed
Fix failing webhook tests
1 parent c911a8b commit 76de37c

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

stream_chat/tests/test_client.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,38 @@ def test_get_app_settings(self, client: StreamChat):
128128
assert "app" in configs
129129

130130
def test_update_app_settings(self, client: StreamChat):
131+
# Get current app settings to verify event hooks support
132+
response = client.get_app_settings()
133+
assert "app" in response
134+
131135
client.update_app_settings(
132-
async_moderation_config={
133-
"callback": {
134-
"mode": "CALLBACK_MODE_REST",
135-
"server_url": "http://example.com/callback",
136+
event_hooks=[
137+
{
138+
"enabled": True,
139+
"hook_type": "webhook",
140+
"webhook_url": "https://example.com/webhook",
141+
"event_types": ["message.new", "message.updated"],
136142
},
137-
"timeout_ms": 10000, # how long messages should stay pending before being deleted
138-
}
143+
{
144+
"enabled": True,
145+
"hook_type": "webhook",
146+
"webhook_url": "https://secondary-webhook-url.com",
147+
"event_types": [],
148+
},
149+
{
150+
"enabled": True,
151+
"hook_type": "pending_message",
152+
"webhook_url": "http://test-url.com",
153+
"timeout_ms": 500,
154+
"callback": {
155+
"mode": "CALLBACK_MODE_REST",
156+
},
157+
},
158+
]
139159
)
140160

161+
client.update_app_settings(event_hooks=[])
162+
141163
def test_update_user(self, client: StreamChat):
142164
user = {"id": str(uuid.uuid4())}
143165
response = client.upsert_user(user)

0 commit comments

Comments
 (0)