aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2019-08-24 19:00:12 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2019-08-25 19:42:06 +0200
commitf5cfdabb740ddbebf379fa93f9cb80b00ace2c48 (patch)
tree770e42a42f620cf3837367328f47acc52c6ef454 /_pytest
parentc35a6d81368f81e9d2ac991c9f4ae0d22405918b (diff)
downloadwee-slack-f5cfdabb740ddbebf379fa93f9cb80b00ace2c48.tar.gz
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.
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/test_linkifytext.py5
1 files changed, 5 insertions, 0 deletions
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)