aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2018-01-14 23:48:07 +0100
committerGitHub <noreply@github.com>2018-01-14 23:48:07 +0100
commit5e16fa41535a0347b34adca89a13560aec6d36bc (patch)
treeea519d51b0c59e60af531ef519955a371c5df40a /_pytest
parent309eeedb66ad31e7ef273e2d6ffc273efcc3de30 (diff)
parent9fdd3d95e48afcbf8e10171ec08fd4698b4b455b (diff)
downloadwee-slack-5e16fa41535a0347b34adca89a13560aec6d36bc.tar.gz
Merge pull request #444 from trygveaa/feat/unfurl-prevent-auto-linking
feat: Remove Slacks auto prefixing of url protocols
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/test_unfurl.py25
1 files changed, 24 insertions, 1 deletions
diff --git a/_pytest/test_unfurl.py b/_pytest/test_unfurl.py
index eebe446..40674b4 100644
--- a/_pytest/test_unfurl.py
+++ b/_pytest/test_unfurl.py
@@ -31,6 +31,26 @@ slack = wee_slack
'output': "url: https://example.com (example with spaces) suffix",
},
{
+ 'input': "url: <https://example.com|example.com> suffix",
+ 'output': "url: example.com suffix",
+ 'auto_link_display': 'text',
+ },
+ {
+ 'input': "url: <https://example.com|different text> suffix",
+ 'output': "url: https://example.com (different text) suffix",
+ 'auto_link_display': 'text',
+ },
+ {
+ 'input': "url: <https://example.com|different text> suffix",
+ 'output': "url: https://example.com (different text) suffix",
+ 'auto_link_display': 'url',
+ },
+ {
+ 'input': "url: <https://example.com|example.com> suffix",
+ 'output': "url: https://example.com suffix",
+ 'auto_link_display': 'url',
+ },
+ {
'input': "<@U407ABLLW|@othernick> multiple unfurl <https://example.com|example with spaces>",
'output': "@othernick multiple unfurl https://example.com (example with spaces)",
},
@@ -47,5 +67,8 @@ def test_unfurl_refs(case, realish_eventrouter):
slack.EVENTROUTER = realish_eventrouter
result = slack.unfurl_refs(
- case['input'], ignore_alt_text=case.get('ignore_alt_text', False))
+ case['input'],
+ ignore_alt_text=case.get('ignore_alt_text', False),
+ auto_link_display=case.get('auto_link_display', 'both'),
+ )
assert result == case['output']