From 5f8c386456eee7238afcf7c4c5d961cad1c06b67 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Mon, 16 Mar 2026 14:19:54 -0400 Subject: [PATCH] chore: format project to latest black version --- slack_bolt/app/app.py | 4 +- slack_bolt/app/async_app.py | 6 +- slack_bolt/middleware/assistant/assistant.py | 18 ++-- .../middleware/assistant/async_assistant.py | 26 ++--- slack_bolt/request/payload_utils.py | 1 - tests/scenario_tests/test_view_submission.py | 1 - .../test_view_submission.py | 1 - .../logger/test_unmatched_suggestions.py | 98 ++++++------------- .../logger/test_unmatched_suggestions.py | 98 ++++++------------- 9 files changed, 83 insertions(+), 170 deletions(-) diff --git a/slack_bolt/app/app.py b/slack_bolt/app/app.py index 5a7f32917..fcf5bb788 100644 --- a/slack_bolt/app/app.py +++ b/slack_bolt/app/app.py @@ -1401,7 +1401,7 @@ def _init_context(self, req: BoltRequest): # For AI Agents & Assistants if is_assistant_event(req.body): assistant = AssistantUtilities( - payload=to_event(req.body), # type:ignore[arg-type] + payload=to_event(req.body), # type: ignore[arg-type] context=req.context, thread_context_store=self._assistant_thread_context_store, ) @@ -1457,7 +1457,7 @@ def _register_listener( CustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, # type:ignore[arg-type] + lazy_functions=functions, # type: ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, diff --git a/slack_bolt/app/async_app.py b/slack_bolt/app/async_app.py index 39f3c3c0e..62c491084 100644 --- a/slack_bolt/app/async_app.py +++ b/slack_bolt/app/async_app.py @@ -616,7 +616,7 @@ async def async_middleware_next(): self._framework_logger.debug(debug_checking_listener(listener_name)) if await listener.async_matches(req=req, resp=resp): # type: ignore[arg-type] # run all the middleware attached to this listener first - (middleware_resp, next_was_not_called) = await listener.run_async_middleware( + middleware_resp, next_was_not_called = await listener.run_async_middleware( req=req, resp=resp # type: ignore[arg-type] ) if next_was_not_called: @@ -1434,7 +1434,7 @@ def _init_context(self, req: AsyncBoltRequest): # For AI Agents & Assistants if is_assistant_event(req.body): assistant = AsyncAssistantUtilities( - payload=to_event(req.body), # type:ignore[arg-type] + payload=to_event(req.body), # type: ignore[arg-type] context=req.context, thread_context_store=self._assistant_thread_context_store, ) @@ -1495,7 +1495,7 @@ def _register_listener( AsyncCustomListener( app_name=self.name, ack_function=functions.pop(0), - lazy_functions=functions, # type:ignore[arg-type] + lazy_functions=functions, # type: ignore[arg-type] matchers=listener_matchers, middleware=listener_middleware, auto_acknowledgement=auto_acknowledgement, diff --git a/slack_bolt/middleware/assistant/assistant.py b/slack_bolt/middleware/assistant/assistant.py index beac71bca..d61386105 100644 --- a/slack_bolt/middleware/assistant/assistant.py +++ b/slack_bolt/middleware/assistant/assistant.py @@ -67,7 +67,7 @@ def thread_started( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -106,7 +106,7 @@ def user_message( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -145,7 +145,7 @@ def bot_message( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -184,7 +184,7 @@ def thread_context_changed( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -214,13 +214,13 @@ def _merge_matchers( ): return [CustomListenerMatcher(app_name=self.app_name, func=primary_matcher)] + ( custom_matchers or [] - ) # type:ignore[operator] + ) # type: ignore[operator] @staticmethod def default_thread_context_changed(save_thread_context: SaveThreadContext, payload: dict): save_thread_context(payload["assistant_thread"]["context"]) - def process( # type:ignore[return] + def process( # type: ignore[return] self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse] ) -> Optional[BoltResponse]: if self._thread_context_changed_listeners is None: @@ -255,8 +255,8 @@ def build_listener( middleware: Optional[List[Middleware]] = None, base_logger: Optional[Logger] = None, ) -> Listener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, Listener): return listener_or_functions @@ -270,7 +270,7 @@ def build_listener( for matcher in matchers: if isinstance(matcher, ListenerMatcher): listener_matchers.append(matcher) - elif isinstance(matcher, Callable): # type:ignore[arg-type] + elif isinstance(matcher, Callable): # type: ignore[arg-type] listener_matchers.append( build_listener_matcher( func=matcher, diff --git a/slack_bolt/middleware/assistant/async_assistant.py b/slack_bolt/middleware/assistant/async_assistant.py index 2fdd828d7..ae82595a8 100644 --- a/slack_bolt/middleware/assistant/async_assistant.py +++ b/slack_bolt/middleware/assistant/async_assistant.py @@ -63,7 +63,7 @@ def thread_started( func=is_assistant_thread_started_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -72,7 +72,7 @@ def thread_started( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -109,7 +109,7 @@ def user_message( func=is_user_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -118,7 +118,7 @@ def user_message( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -155,7 +155,7 @@ def bot_message( func=is_bot_message_event_in_assistant_thread, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -164,7 +164,7 @@ def bot_message( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -201,7 +201,7 @@ def thread_context_changed( func=is_assistant_thread_context_changed_event, asyncio=True, base_logger=self.base_logger, - ), # type:ignore[arg-type] + ), # type: ignore[arg-type] matchers, ) if is_used_without_argument(args): @@ -210,7 +210,7 @@ def thread_context_changed( self.build_listener( listener_or_functions=func, matchers=all_matchers, - middleware=middleware, # type:ignore[arg-type] + middleware=middleware, # type: ignore[arg-type] ) ) return func @@ -238,14 +238,14 @@ def _merge_matchers( primary_matcher: Union[Callable[..., bool], AsyncListenerMatcher], custom_matchers: Optional[Union[Callable[..., bool], AsyncListenerMatcher]], ): - return [primary_matcher] + (custom_matchers or []) # type:ignore[operator] + return [primary_matcher] + (custom_matchers or []) # type: ignore[operator] @staticmethod async def default_thread_context_changed(save_thread_context: AsyncSaveThreadContext, payload: dict): new_context: dict = payload["assistant_thread"]["context"] await save_thread_context(new_context) - async def async_process( # type:ignore[return] + async def async_process( # type: ignore[return] self, *, req: AsyncBoltRequest, @@ -284,8 +284,8 @@ def build_listener( middleware: Optional[List[AsyncMiddleware]] = None, base_logger: Optional[Logger] = None, ) -> AsyncListener: - if isinstance(listener_or_functions, Callable): # type:ignore[arg-type] - listener_or_functions = [listener_or_functions] # type:ignore[list-item] + if isinstance(listener_or_functions, Callable): # type: ignore[arg-type] + listener_or_functions = [listener_or_functions] # type: ignore[list-item] if isinstance(listener_or_functions, AsyncListener): return listener_or_functions @@ -302,7 +302,7 @@ def build_listener( else: listener_matchers.append( build_listener_matcher( - func=matcher, # type:ignore[arg-type] + func=matcher, # type: ignore[arg-type] asyncio=True, base_logger=base_logger, ) diff --git a/slack_bolt/request/payload_utils.py b/slack_bolt/request/payload_utils.py index c1016c65d..1ebf70d4f 100644 --- a/slack_bolt/request/payload_utils.py +++ b/slack_bolt/request/payload_utils.py @@ -1,6 +1,5 @@ from typing import Dict, Any, Optional - # ------------------------------------------ # Public Utilities # ------------------------------------------ diff --git a/tests/scenario_tests/test_view_submission.py b/tests/scenario_tests/test_view_submission.py index b0eb58212..0f5b23f85 100644 --- a/tests/scenario_tests/test_view_submission.py +++ b/tests/scenario_tests/test_view_submission.py @@ -14,7 +14,6 @@ ) from tests.utils import remove_os_env_temporarily, restore_os_env - body = { "type": "view_submission", "team": { diff --git a/tests/scenario_tests_async/test_view_submission.py b/tests/scenario_tests_async/test_view_submission.py index 49a6e8fc5..6511243fa 100644 --- a/tests/scenario_tests_async/test_view_submission.py +++ b/tests/scenario_tests_async/test_view_submission.py @@ -15,7 +15,6 @@ ) from tests.utils import remove_os_env_temporarily, restore_os_env - body = { "type": "view_submission", "team": { diff --git a/tests/slack_bolt/logger/test_unmatched_suggestions.py b/tests/slack_bolt/logger/test_unmatched_suggestions.py index 2c0c82b99..b470fa061 100644 --- a/tests/slack_bolt/logger/test_unmatched_suggestions.py +++ b/tests/slack_bolt/logger/test_unmatched_suggestions.py @@ -22,8 +22,7 @@ def test_block_actions(self): "block_id": "b", "action_id": "action-id-value", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -31,9 +30,7 @@ def test_block_actions(self): def handle_some_action(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_attachment_actions(self): req: BoltRequest = BoltRequest(body=attachment_actions, mode="socket_mode") @@ -49,8 +46,7 @@ def test_attachment_actions(self): } ], } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -58,9 +54,7 @@ def test_attachment_actions(self): def handle_some_action(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_app_mention_event(self): req: BoltRequest = BoltRequest(body=app_mention_event, mode="socket_mode") @@ -69,17 +63,14 @@ def test_app_mention_event(self): "event": {"type": "app_mention"}, } message = warning_unhandled_request(req) - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.event("app_mention") def handle_app_mention_events(body, logger): logger.info(body) -""" - == message - ) +""" == message def test_function_event(self): req: BoltRequest = BoltRequest(body=function_event, mode="socket_mode") @@ -88,8 +79,7 @@ def test_function_event(self): "event": {"type": "function_executed"}, } message = warning_unhandled_request(req) - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -104,9 +94,7 @@ def handle_some_function(ack, body, complete, fail, logger): except Exception as e: error = f"Failed to handle a function request (error: {{e}})" fail(error=error) -""" - == message - ) +""" == message def test_commands(self): req: BoltRequest = BoltRequest(body=slash_command, mode="socket_mode") @@ -115,8 +103,7 @@ def test_commands(self): "type": None, "command": "/start-conv", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -124,9 +111,7 @@ def test_commands(self): def handle_some_command(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_shortcut(self): req: BoltRequest = BoltRequest(body=global_shortcut, mode="socket_mode") @@ -135,8 +120,7 @@ def test_shortcut(self): "type": "shortcut", "callback_id": "test-shortcut", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -144,9 +128,7 @@ def test_shortcut(self): def handle_shortcuts(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message req: BoltRequest = BoltRequest(body=message_shortcut, mode="socket_mode") message = warning_unhandled_request(req) @@ -154,8 +136,7 @@ def handle_shortcuts(ack, body, logger): "type": "message_action", "callback_id": "test-shortcut", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -163,9 +144,7 @@ def handle_shortcuts(ack, body, logger): def handle_shortcuts(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_view(self): req: BoltRequest = BoltRequest(body=view_submission, mode="socket_mode") @@ -174,8 +153,7 @@ def test_view(self): "type": "view_submission", "view": {"type": "modal", "callback_id": "view-id"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -183,9 +161,7 @@ def test_view(self): def handle_view_submission_events(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message req: BoltRequest = BoltRequest(body=view_closed, mode="socket_mode") message = warning_unhandled_request(req) @@ -193,8 +169,7 @@ def handle_view_submission_events(ack, body, logger): "type": "view_closed", "view": {"type": "modal", "callback_id": "view-id"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -202,9 +177,7 @@ def handle_view_submission_events(ack, body, logger): def handle_view_closed_events(ack, body, logger): ack() logger.info(body) -""" - == message - ) +""" == message def test_block_suggestion(self): req: BoltRequest = BoltRequest(body=block_suggestion, mode="socket_mode") @@ -216,17 +189,14 @@ def test_block_suggestion(self): "action_id": "the-id", "value": "search word", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.options("the-id") def handle_some_options(ack): ack(options=[ ... ]) -""" - == message - ) +""" == message def test_dialog_suggestion(self): req: BoltRequest = BoltRequest(body=dialog_suggestion, mode="socket_mode") @@ -236,17 +206,14 @@ def test_dialog_suggestion(self): "callback_id": "the-id", "value": "search keyword", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.options({{"type": "dialog_suggestion", "callback_id": "the-id"}}) def handle_some_options(ack): ack(options=[ ... ]) -""" - == message - ) +""" == message def test_step(self): req: BoltRequest = BoltRequest(body=step_edit_payload, mode="socket_mode") @@ -255,8 +222,7 @@ def test_step(self): "type": "workflow_step_edit", "callback_id": "copy_review", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -269,17 +235,14 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message req: BoltRequest = BoltRequest(body=step_save_payload, mode="socket_mode") message = warning_unhandled_request(req) filtered_body = { "type": "view_submission", "view": {"type": "workflow_step", "callback_id": "copy_review"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -292,17 +255,14 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message req: BoltRequest = BoltRequest(body=step_execute_payload, mode="socket_mode") message = warning_unhandled_request(req) filtered_body = { "type": "event_callback", "event": {"type": "workflow_step_execute"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -315,9 +275,7 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message block_actions = { diff --git a/tests/slack_bolt_async/logger/test_unmatched_suggestions.py b/tests/slack_bolt_async/logger/test_unmatched_suggestions.py index 93343c4a2..d8c659892 100644 --- a/tests/slack_bolt_async/logger/test_unmatched_suggestions.py +++ b/tests/slack_bolt_async/logger/test_unmatched_suggestions.py @@ -22,8 +22,7 @@ def test_block_actions(self): "block_id": "b", "action_id": "action-id-value", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -31,9 +30,7 @@ def test_block_actions(self): async def handle_some_action(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_attachment_actions(self): req: AsyncBoltRequest = AsyncBoltRequest(body=attachment_actions, mode="socket_mode") @@ -49,8 +46,7 @@ def test_attachment_actions(self): } ], } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -58,9 +54,7 @@ def test_attachment_actions(self): async def handle_some_action(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_app_mention_event(self): req: AsyncBoltRequest = AsyncBoltRequest(body=app_mention_event, mode="socket_mode") @@ -69,17 +63,14 @@ def test_app_mention_event(self): "event": {"type": "app_mention"}, } message = warning_unhandled_request(req) - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.event("app_mention") async def handle_app_mention_events(body, logger): logger.info(body) -""" - == message - ) +""" == message def test_function_event(self): req: AsyncBoltRequest = AsyncBoltRequest(body=function_event, mode="socket_mode") @@ -88,8 +79,7 @@ def test_function_event(self): "event": {"type": "function_executed"}, } message = warning_unhandled_request(req) - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -104,9 +94,7 @@ async def handle_some_function(ack, body, complete, fail, logger): except Exception as e: error = f"Failed to handle a function request (error: {{e}})" await fail(error=error) -""" - == message - ) +""" == message def test_commands(self): req: AsyncBoltRequest = AsyncBoltRequest(body=slash_command, mode="socket_mode") @@ -115,8 +103,7 @@ def test_commands(self): "type": None, "command": "/start-conv", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -124,9 +111,7 @@ def test_commands(self): async def handle_some_command(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_shortcut(self): req: AsyncBoltRequest = AsyncBoltRequest(body=global_shortcut, mode="socket_mode") @@ -135,8 +120,7 @@ def test_shortcut(self): "type": "shortcut", "callback_id": "test-shortcut", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -144,9 +128,7 @@ def test_shortcut(self): async def handle_shortcuts(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message req: AsyncBoltRequest = AsyncBoltRequest(body=message_shortcut, mode="socket_mode") message = warning_unhandled_request(req) @@ -154,8 +136,7 @@ async def handle_shortcuts(ack, body, logger): "type": "message_action", "callback_id": "test-shortcut", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -163,9 +144,7 @@ async def handle_shortcuts(ack, body, logger): async def handle_shortcuts(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_view(self): req: AsyncBoltRequest = AsyncBoltRequest(body=view_submission, mode="socket_mode") @@ -174,8 +153,7 @@ def test_view(self): "type": "view_submission", "view": {"type": "modal", "callback_id": "view-id"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -183,9 +161,7 @@ def test_view(self): async def handle_view_submission_events(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message req: AsyncBoltRequest = AsyncBoltRequest(body=view_closed, mode="socket_mode") message = warning_unhandled_request(req) @@ -193,8 +169,7 @@ async def handle_view_submission_events(ack, body, logger): "type": "view_closed", "view": {"type": "modal", "callback_id": "view-id"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -202,9 +177,7 @@ async def handle_view_submission_events(ack, body, logger): async def handle_view_closed_events(ack, body, logger): await ack() logger.info(body) -""" - == message - ) +""" == message def test_block_suggestion(self): req: AsyncBoltRequest = AsyncBoltRequest(body=block_suggestion, mode="socket_mode") @@ -216,17 +189,14 @@ def test_block_suggestion(self): "action_id": "the-id", "value": "search word", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.options("the-id") async def handle_some_options(ack): await ack(options=[ ... ]) -""" - == message - ) +""" == message def test_dialog_suggestion(self): req: AsyncBoltRequest = AsyncBoltRequest(body=dialog_suggestion, mode="socket_mode") @@ -236,17 +206,14 @@ def test_dialog_suggestion(self): "callback_id": "the-id", "value": "search keyword", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @app.options({{"type": "dialog_suggestion", "callback_id": "the-id"}}) async def handle_some_options(ack): await ack(options=[ ... ]) -""" - == message - ) +""" == message def test_step(self): req: AsyncBoltRequest = AsyncBoltRequest(body=step_edit_payload, mode="socket_mode") @@ -255,8 +222,7 @@ def test_step(self): "type": "workflow_step_edit", "callback_id": "copy_review", } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -269,17 +235,14 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message req: AsyncBoltRequest = AsyncBoltRequest(body=step_save_payload, mode="socket_mode") message = warning_unhandled_request(req) filtered_body = { "type": "view_submission", "view": {"type": "workflow_step", "callback_id": "copy_review"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -292,17 +255,14 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message req: AsyncBoltRequest = AsyncBoltRequest(body=step_execute_payload, mode="socket_mode") message = warning_unhandled_request(req) filtered_body = { "type": "event_callback", "event": {"type": "workflow_step_execute"}, } - assert ( - f"""Unhandled request ({filtered_body}) + assert f"""Unhandled request ({filtered_body}) --- [Suggestion] You can handle this type of event with the following listener function: @@ -315,9 +275,7 @@ def test_step(self): ) # Pass Step to set up listeners app.step(ws) -""" - == message - ) +""" == message block_actions = {