Skip to content

Commit

Permalink
Additional changes to #1609
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Dec 5, 2024
1 parent 8b8085e commit fb69194
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions slack_sdk/socket_mode/aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def __init__(
on_message_listeners: listener functions for on_message
on_error_listeners: listener functions for on_error
on_close_listeners: listener functions for on_close
loop: an existing asyncio event loop
"""
self.app_token = app_token
self.logger = logger or logging.getLogger(__name__)
Expand Down
14 changes: 14 additions & 0 deletions tests/slack_sdk_async/socket_mode/test_aiohttp.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import asyncio
import unittest

from slack_sdk.socket_mode.aiohttp import SocketModeClient
Expand Down Expand Up @@ -30,6 +31,19 @@ async def test_init_close(self):
finally:
await client.close()

@async_test
async def test_init_with_loop(self):
client = SocketModeClient(
app_token="xapp-A111-222-xyz",
web_client=self.web_client,
auto_reconnect_enabled=False,
loop=asyncio.new_event_loop(),
)
try:
self.assertIsNotNone(client)
finally:
await client.close()

@async_test
async def test_issue_new_wss_url(self):
client = SocketModeClient(
Expand Down

0 comments on commit fb69194

Please sign in to comment.