diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2019-08-24 19:00:12 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2019-08-25 19:42:06 +0200 |
commit | f5cfdabb740ddbebf379fa93f9cb80b00ace2c48 (patch) | |
tree | 770e42a42f620cf3837367328f47acc52c6ef454 /_pytest/test_linkifytext.py | |
parent | c35a6d81368f81e9d2ac991c9f4ae0d22405918b (diff) | |
download | wee-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/test_linkifytext.py')
-rw-r--r-- | _pytest/test_linkifytext.py | 5 |
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) |