Skip to content

Commit 6ddc8d3

Browse files
committed
add async tests
1 parent 406a8e3 commit 6ddc8d3

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

tests/slack_sdk_async/web/test_async_chat_stream.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,23 @@ async def test_streams_a_chunk_message(self):
244244
'[{"text": "\\n", "type": "markdown_text"}, {"text": ":space_invader:", "type": "markdown_text"}]',
245245
)
246246

247+
@async_test
248+
async def test_ts_property_is_none_before_flush_and_set_after(self):
249+
streamer = await self.client.chat_stream(
250+
buffer_size=5,
251+
channel="C0123456789",
252+
thread_ts="123.000",
253+
recipient_team_id="T0123456789",
254+
recipient_user_id="U0123456789",
255+
)
256+
self.assertIsNone(streamer.ts)
257+
258+
await streamer.append(markdown_text="hello!")
259+
self.assertEqual(streamer.ts, "123.123")
260+
261+
await streamer.stop()
262+
self.assertEqual(streamer.ts, "123.123")
263+
247264
@async_test
248265
async def test_streams_errors_when_appending_to_an_unstarted_stream(self):
249266
streamer = await self.client.chat_stream(

0 commit comments

Comments
 (0)