Skip to content

Commit

Permalink
Fix black failures
Browse files Browse the repository at this point in the history
  • Loading branch information
unode committed Aug 22, 2022
1 parent 2a46e4a commit 97ed594
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
14 changes: 8 additions & 6 deletions mmpy_bot/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ class Driver(mattermostautodriver.Driver):
username: str = ""

def __init__(self, *args, num_threads=10, **kwargs):
"""Wrapper around the mattermostautodriver Driver with some convenience functions
and attributes.
"""Wrapper around the mattermostautodriver Driver with some convenience
functions and attributes.
Arguments:
- num_threads: int, number of threads to use for the default worker threadpool.
Expand Down Expand Up @@ -78,7 +78,9 @@ def create_post(
return self.posts.create_post(post)

def get_thread(self, post_id: str):
warnings.warn("get_thread is deprecated. Use get_post_thread instead", DeprecationWarning)
warnings.warn(
"get_thread is deprecated. Use get_post_thread instead", DeprecationWarning
)
return self.get_post_thread(post_id)

def get_post_thread(self, post_id: str):
Expand Down Expand Up @@ -163,9 +165,9 @@ def direct_message(
):
# Private/direct messages are sent to a special channel that
# includes the bot and the recipient
direct_id = self.channels.create_direct_channel(
[self.user_id, receiver_id]
)["id"]
direct_id = self.channels.create_direct_channel([self.user_id, receiver_id])[
"id"
]

return self.create_post(
channel_id=direct_id,
Expand Down
4 changes: 3 additions & 1 deletion tests/integration_tests/test_direct_message_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def bot_and_user_direct_channel(channel):
# which is implemented by mattermost as a channel
driver.create_post(OFF_TOPIC_ID, trigger)

user_channels = driver.channels.get_channels_for_team_for_user(driver.user_id, TEAM_ID)
user_channels = driver.channels.get_channels_for_team_for_user(
driver.user_id, TEAM_ID
)
channels = list(filter(bot_and_user_direct_channel, user_channels))

# We need to wait for the reply to be processed by mattermost
Expand Down

0 comments on commit 97ed594

Please sign in to comment.