Skip to content

Commit 5ec3366

Browse files
Update test_events_assistant_without_middleware.py
1 parent 27e6723 commit 5ec3366

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

tests/scenario_tests_async/test_events_assistant_without_middleware.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ async def handle_message_event(
195195
save_thread_context: AsyncSaveThreadContext,
196196
context: AsyncBoltContext,
197197
):
198-
assert context.thread_ts is None
199-
assert say.thread_ts == context.thread_ts
198+
assert context.thread_ts == "1726133698.626339"
199+
assert say.thread_ts == None
200200
assert set_status is None
201201
assert set_title is None
202202
assert set_suggested_prompts is None
@@ -224,8 +224,8 @@ async def handle_message_event(
224224
save_thread_context: AsyncSaveThreadContext,
225225
context: AsyncBoltContext,
226226
):
227-
assert context.thread_ts is None
228-
assert say.thread_ts == context.thread_ts
227+
assert context.thread_ts == "1726133698.626339"
228+
assert say.thread_ts == None
229229
assert set_status is None
230230
assert set_title is None
231231
assert set_suggested_prompts is None
@@ -253,8 +253,8 @@ async def handle_message_event(
253253
save_thread_context: AsyncSaveThreadContext,
254254
context: AsyncBoltContext,
255255
):
256-
assert context.thread_ts is None
257-
assert say.thread_ts == context.thread_ts
256+
assert context.thread_ts == "1726133698.626339"
257+
assert say.thread_ts == None
258258
assert set_status is None
259259
assert set_title is None
260260
assert set_suggested_prompts is None
@@ -266,3 +266,23 @@ async def handle_message_event(
266266
response = await app.async_dispatch(request)
267267
assert response.status == 200
268268
await assert_target_called(called)
269+
270+
@pytest.mark.asyncio
271+
async def test_assistant_events_agent_kwargs_disabled(self):
272+
app = AsyncApp(client=self.web_client, attaching_agent_kwargs_enabled=False)
273+
274+
called = {"value": False}
275+
276+
@app.event("assistant_thread_started")
277+
async def start_thread(context: AsyncBoltContext):
278+
assert context.get("set_status") is None
279+
assert context.get("set_title") is None
280+
assert context.get("set_suggested_prompts") is None
281+
assert context.get("get_thread_context") is None
282+
assert context.get("save_thread_context") is None
283+
called["value"] = True
284+
285+
request = AsyncBoltRequest(body=thread_started_event_body, mode="socket_mode")
286+
response = await app.async_dispatch(request)
287+
assert response.status == 200
288+
await assert_target_called(called)

0 commit comments

Comments
 (0)