@@ -79,21 +79,20 @@ def test_initialization(self, mock_socket_mode_client, mock_web_client):
7979
8080 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
8181 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
82- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger )
82+ listener = SlackSocketListener (logger = logger )
8383
84- assert listener .channel_id == CHANNEL_ID
8584 assert listener .logger == logger
8685 assert listener .running is True
8786 mock_socket_mode_client .assert_called_once ()
8887 mock_web_client .assert_called_once ()
8988
9089 def test_should_process_app_mention (self , mock_socket_mode_client , mock_web_client ):
91- """Test that app_mention events in the correct channel are processed."""
90+ """Test that app_mention events are processed."""
9291 logger = logging .getLogger ("test" )
9392
9493 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
9594 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
96- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger )
95+ listener = SlackSocketListener (logger = logger )
9796
9897 event = create_app_mention_event (
9998 text = "<@UBOTID> analyze this failure" ,
@@ -102,23 +101,23 @@ def test_should_process_app_mention(self, mock_socket_mode_client, mock_web_clie
102101
103102 assert listener ._should_process_message (event ) is True
104103
105- def test_should_not_process_wrong_channel (
104+ def test_should_process_any_channel (
106105 self , mock_socket_mode_client , mock_web_client
107106 ):
108- """Test that mentions in other channels are ignored ."""
107+ """Test that mentions in any channel are processed ."""
109108 logger = logging .getLogger ("test" )
110109
111110 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
112111 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
113- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger )
112+ listener = SlackSocketListener (logger = logger )
114113
115114 event = create_app_mention_event (
116115 text = "<@UBOTID> analyze this failure" ,
117116 user = "U12345" ,
118117 )
119118 event ["channel" ] = "C_DIFFERENT_CHANNEL"
120119
121- assert listener ._should_process_message (event ) is False
120+ assert listener ._should_process_message (event ) is True
122121
123122 def test_should_not_process_bot_self_mention (
124123 self , mock_socket_mode_client , mock_web_client
@@ -129,7 +128,7 @@ def test_should_not_process_bot_self_mention(
129128 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
130129 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
131130 with patch ("bugzooka.integrations.slack_socket_listener.JEDI_BOT_SLACK_USER_ID" , "UBOTID" ):
132- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger )
131+ listener = SlackSocketListener (logger = logger )
133132
134133 event = create_app_mention_event (
135134 text = "<@UBOTID> analyze this failure" ,
@@ -146,7 +145,7 @@ def test_process_mention_sends_greeting(
146145
147146 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
148147 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
149- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger )
148+ listener = SlackSocketListener (logger = logger )
150149
151150 event = create_app_mention_event (
152151 text = "<@UBOTID> hello" ,
@@ -172,7 +171,7 @@ def test_submit_mention_for_processing(
172171
173172 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
174173 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
175- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger , max_workers = 2 )
174+ listener = SlackSocketListener (logger = logger , max_workers = 2 )
176175
177176 event = create_app_mention_event (
178177 text = "<@UBOTID> async test" ,
@@ -197,7 +196,7 @@ def test_submit_mention_prevents_duplicates(
197196
198197 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
199198 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
200- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger , max_workers = 2 )
199+ listener = SlackSocketListener (logger = logger , max_workers = 2 )
201200
202201 event = create_app_mention_event (
203202 text = "<@UBOTID> duplicate test" ,
@@ -222,7 +221,7 @@ def test_process_socket_request_acknowledgement(
222221
223222 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
224223 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
225- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger )
224+ listener = SlackSocketListener (logger = logger )
226225
227226 event = create_app_mention_event (text = "<@UBOTID> test" , ts = "1234567890.123456" )
228227 socket_request = create_socket_mode_request (event )
@@ -246,7 +245,7 @@ def test_process_socket_request_adds_reaction_immediately(
246245
247246 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
248247 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
249- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger )
248+ listener = SlackSocketListener (logger = logger )
250249
251250 event = create_app_mention_event (
252251 text = "<@UBOTID> test" ,
@@ -275,7 +274,7 @@ def test_process_socket_request_non_app_mention(
275274
276275 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
277276 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
278- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger )
277+ listener = SlackSocketListener (logger = logger )
279278
280279 # Create a different event type
281280 event = {
@@ -302,7 +301,7 @@ def test_process_mention_error_handling(
302301
303302 with patch ("bugzooka.core.config.SLACK_BOT_TOKEN" , "xoxb-test-token" ):
304303 with patch ("bugzooka.core.config.SLACK_APP_TOKEN" , "xapp-test-token" ):
305- listener = SlackSocketListener (channel_id = CHANNEL_ID , logger = logger )
304+ listener = SlackSocketListener (logger = logger )
306305
307306 # Mock chat_postMessage to raise an exception
308307 mock_web_client .return_value .chat_postMessage .side_effect = Exception (
0 commit comments