Skip to content

Commit 68a0b64

Browse files
committed
fix: keep old test cases alongside new ones
1 parent 570a1e2 commit 68a0b64

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

tests/scenario_tests/test_events_assistant.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ def handle_user_message(say: Say, set_status: SetStatus, context: BoltContext):
9090
assert response.status == 200
9191
assert_target_called()
9292

93+
request = BoltRequest(body=user_message_event_body_with_action_token, mode="socket_mode")
94+
response = app.dispatch(request)
95+
assert response.status == 200
96+
assert_target_called()
97+
9398
request = BoltRequest(body=message_changed_event_body, mode="socket_mode")
9499
response = app.dispatch(request)
95100
assert response.status == 200
@@ -172,6 +177,25 @@ def build_payload(event: dict) -> dict:
172177

173178

174179
user_message_event_body_with_assistant_thread = build_payload(
180+
{
181+
"user": "W222",
182+
"type": "message",
183+
"ts": "1726133700.887259",
184+
"text": "When Slack was released?",
185+
"team": "T111",
186+
"user_team": "T111",
187+
"source_team": "T222",
188+
"user_profile": {},
189+
"thread_ts": "1726133698.626339",
190+
"parent_user_id": "W222",
191+
"channel": "D111",
192+
"event_ts": "1726133700.887259",
193+
"channel_type": "im",
194+
"assistant_thread": {"XXX": "YYY"},
195+
}
196+
)
197+
198+
user_message_event_body_with_action_token = build_payload(
175199
{
176200
"user": "W222",
177201
"type": "message",

tests/scenario_tests_async/test_events_assistant.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ async def handle_user_message(say: AsyncSay, set_status: AsyncSetStatus, context
104104
assert response.status == 200
105105
await assert_target_called()
106106

107+
request = AsyncBoltRequest(body=user_message_event_body_with_action_token, mode="socket_mode")
108+
response = await app.async_dispatch(request)
109+
assert response.status == 200
110+
await assert_target_called()
111+
107112
request = AsyncBoltRequest(body=message_changed_event_body, mode="socket_mode")
108113
response = await app.async_dispatch(request)
109114
assert response.status == 200
@@ -200,11 +205,30 @@ def build_payload(event: dict) -> dict:
200205
"channel": "D111",
201206
"event_ts": "1726133700.887259",
202207
"channel_type": "im",
203-
"assistant_thread": {"action_token": "10647138185092.960436384805.afce3599"},
208+
"assistant_thread": {"XXX": "YYY"},
204209
}
205210
)
206211

207212

213+
user_message_event_body_with_action_token = build_payload(
214+
{
215+
"user": "W222",
216+
"type": "message",
217+
"ts": "1726133700.887259",
218+
"text": "When Slack was released?",
219+
"team": "T111",
220+
"user_team": "T111",
221+
"source_team": "T222",
222+
"user_profile": {},
223+
"thread_ts": "1726133698.626339",
224+
"parent_user_id": "W222",
225+
"channel": "D111",
226+
"event_ts": "1726133700.887259",
227+
"channel_type": "im",
228+
"assistant_thread": {"action_token": "10647138185092.960436384805.afce3599"},
229+
}
230+
)
231+
208232
message_changed_event_body = build_payload(
209233
{
210234
"type": "message",

0 commit comments

Comments
 (0)