diff options
Diffstat (limited to '_pytest/test_linkifytext.py')
-rw-r--r-- | _pytest/test_linkifytext.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/_pytest/test_linkifytext.py b/_pytest/test_linkifytext.py index fb251b8..a086fde 100644 --- a/_pytest/test_linkifytext.py +++ b/_pytest/test_linkifytext.py @@ -49,8 +49,35 @@ def test_linkifytext_at_channel(team): assert text == '<!channel>: my test message' +def test_linkifytext_at_group(team): + text = linkify_text('@group: my test message', team) + + assert text == '<!group>: my test message' + +def test_linkifytext_at_here(team): + text = linkify_text('@here: my test message', team) + + assert text == '<!here>: my test message' + def test_linkifytext_channel(team, channel_general): channel_name = re.sub(r'^[#&]', '', channel_general.name) text = linkify_text('#{}: my test message'.format(channel_name), team) assert text == '<#{}|{}>: my test message'.format(channel_general.id, channel_name) + +def test_linkifytext_not_private_using_hash(team, channel_private): + channel_name = re.sub(r'^[#&]', '', channel_private.name) + text = linkify_text('#{}: my test message'.format(channel_name), team) + + assert text == '#{}: my test message'.format(channel_name) + +def test_linkifytext_not_private_using_ampersand(team, channel_private): + channel_name = re.sub(r'^[#&]', '', channel_private.name) + text = linkify_text('&{}: my test message'.format(channel_name), team) + + assert text == '&{}: my test message'.format(channel_name) + +def test_linkifytext_not_dm(team, channel_dm): + text = linkify_text('#{}: my test message'.format(channel_dm.name), team) + + assert text == '#{}: my test message'.format(channel_dm.name) |