Skip to content

Commit 8341b6f

Browse files
fix format issues
1 parent 793b1cd commit 8341b6f

File tree

2 files changed

+17
-33
lines changed

2 files changed

+17
-33
lines changed

slack_sdk/web/internal_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def _warn_if_message_text_content_is_missing(endpoint: str, kwargs: Dict[str, An
252252
markdown_text = kwargs.get("markdown_text")
253253
if (text and len(text.strip()) > 0) or (markdown_text and len(markdown_text.strip()) > 0):
254254
# If a top-level text arg is provided, we are good. This is the recommended accessibility field to always provide.
255-
# If a top-level markdown_text arg is provided, we are good. It should not be used in conjunction with blocks or text.
255+
# If a top-level markdown_text arg is provided, we are good. It should not be used in conjunction with text.
256256
return
257257

258258
# for unit tests etc.

tests/web/test_web_client_issue_891.py

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -67,55 +67,39 @@ def test_missing_fallback_warning_chat_update(self):
6767
with self.assertWarnsRegex(UserWarning, "`fallback` argument is missing"):
6868
resp = client.chat_update(channel="C111", ts="111.222", blocks=[], attachments=[{"text": "hi"}])
6969
self.assertIsNone(resp["error"])
70-
70+
7171
def test_no_warning_when_markdown_text_is_provided_chat_postMessage(self):
7272
client = WebClient(base_url="http://localhost:8888", token="xoxb-api_test")
7373
with warnings.catch_warnings(record=True) as warning_list:
74-
warnings.simplefilter("always")
75-
resp = client.chat_postMessage(
76-
channel="C111",
77-
markdown_text="# hello"
78-
)
79-
74+
warnings.simplefilter("always")
75+
resp = client.chat_postMessage(channel="C111", markdown_text="# hello")
76+
8077
self.assertEqual(warning_list, [])
8178
self.assertIsNone(resp["error"])
82-
79+
8380
def test_no_warning_when_markdown_text_is_provided_chat_postEphemeral(self):
8481
client = WebClient(base_url="http://localhost:8888", token="xoxb-api_test")
8582
with warnings.catch_warnings(record=True) as warning_list:
86-
warnings.simplefilter("always")
87-
resp = client.chat_postEphemeral(
88-
channel="C111",
89-
user="U111",
90-
markdown_text="# hello"
91-
)
92-
83+
warnings.simplefilter("always")
84+
resp = client.chat_postEphemeral(channel="C111", user="U111", markdown_text="# hello")
85+
9386
self.assertEqual(warning_list, [])
9487
self.assertIsNone(resp["error"])
95-
88+
9689
def test_no_warning_when_markdown_text_is_provided_chat_scheduleMessage(self):
9790
client = WebClient(base_url="http://localhost:8888", token="xoxb-api_test")
9891
with warnings.catch_warnings(record=True) as warning_list:
99-
warnings.simplefilter("always")
100-
resp = client.chat_scheduleMessage(
101-
channel="C111",
102-
post_at="299876400",
103-
markdown_text="# hello"
104-
)
105-
92+
warnings.simplefilter("always")
93+
resp = client.chat_scheduleMessage(channel="C111", post_at="299876400", markdown_text="# hello")
94+
10695
self.assertEqual(warning_list, [])
10796
self.assertIsNone(resp["error"])
108-
97+
10998
def test_no_warning_when_markdown_text_is_provided_chat_update(self):
11099
client = WebClient(base_url="http://localhost:8888", token="xoxb-api_test")
111100
with warnings.catch_warnings(record=True) as warning_list:
112-
warnings.simplefilter("always")
113-
resp = client.chat_update(
114-
channel="C111",
115-
ts="111.222",
116-
markdown_text="# hello"
117-
)
118-
101+
warnings.simplefilter("always")
102+
resp = client.chat_update(channel="C111", ts="111.222", markdown_text="# hello")
103+
119104
self.assertEqual(warning_list, [])
120105
self.assertIsNone(resp["error"])
121-

0 commit comments

Comments
 (0)