Skip to content

Commit

Permalink
test thread_ts being passed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
sdoiron0330 committed May 30, 2023
1 parent cb6e7d6 commit 7cc4410
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nautobot_chatops/tests/test_dispatchers.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@ def test_user_session_key(self):
# This should not raise an exception
self.dispatcher.unset_session_entry("key1")

def test_thread_ts_passed_into_slack_client(self):
"""Test thread_ts being passed correctly when it exists in the context."""
self.dispatcher.context.update({"thread_ts": "12345"})
with patch.object(self.dispatcher.slack_client, "chat_postMessage") as mocked_chat_post_message:
self.dispatcher.send_markdown("test message")
mocked_chat_post_message.assert_called_with(
channel="456def", user="abc123", text="test message", thread_ts="12345"
)


class TestMSTeamsDispatcher(TestSlackDispatcher):
"""Test the MSTeamsDispatcher class."""
Expand Down

0 comments on commit 7cc4410

Please sign in to comment.