From f5cfdabb740ddbebf379fa93f9cb80b00ace2c48 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Sat, 24 Aug 2019 19:00:12 +0200 Subject: Refactor linkify_text to use re.sub Instead of splitting the message at spaces and checking and replacing each word, use re.sub for the whole message. --- _pytest/test_linkifytext.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to '_pytest') diff --git a/_pytest/test_linkifytext.py b/_pytest/test_linkifytext.py index 7c67fa6..4f9cd3b 100644 --- a/_pytest/test_linkifytext.py +++ b/_pytest/test_linkifytext.py @@ -86,3 +86,8 @@ 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) + +def test_linkifytext_not_mpdm(team, channel_mpdm): + text = linkify_text('#{}: my test message'.format(channel_mpdm.name), team) + + assert text == '#{}: my test message'.format(channel_mpdm.name) -- cgit