aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest/test_linkifytext.py
diff options
context:
space:
mode:
Diffstat (limited to '_pytest/test_linkifytext.py')
-rw-r--r--_pytest/test_linkifytext.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/_pytest/test_linkifytext.py b/_pytest/test_linkifytext.py
index c8489be..da672dc 100644
--- a/_pytest/test_linkifytext.py
+++ b/_pytest/test_linkifytext.py
@@ -58,3 +58,19 @@ def test_linkifytext_names_with_apostrophe(realish_eventrouter):
text = linkify_text('@O\'Connor: my test message', team, channel)
assert text == '@O\'Connor: my test message'
+
+def test_linkifytext_at_channel(realish_eventrouter):
+ team = realish_eventrouter.teams.values()[0]
+ channel = team.channels.values()[0]
+
+ text = linkify_text('@channel: my test message', team, channel)
+
+ assert text == '<!channel>: my test message'
+
+def test_linkifytext_channel(realish_eventrouter):
+ team = realish_eventrouter.teams.values()[0]
+ channel = team.channels.values()[0]
+
+ text = linkify_text('#{}: my test message'.format(channel.name), team, channel)
+
+ assert text == '<#{}|{}>: my test message'.format(channel.id, channel.name)