aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2020-03-26 22:21:49 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2020-04-05 20:22:46 +0200
commit37f1f7be4b7a10847b0bf0d68875067096a883e5 (patch)
treee487df883c85fc7dc56633e0583aa86da213c65f /_pytest
parent6d852774e39e9c548543bd986f440a33800523de (diff)
downloadwee-slack-37f1f7be4b7a10847b0bf0d68875067096a883e5.tar.gz
Don't add fallback if link exists in text_before
We should only use the fallback if we don't get any information out of the attachment. For links that exists in text_before, we have gotten the information from the attachment, but choose not to display it so we don't end up with duplicate links. Therefore, we shouldn't use the fallback in this case.
Diffstat (limited to '_pytest')
-rw-r--r--_pytest/test_unwrap_attachments.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/_pytest/test_unwrap_attachments.py b/_pytest/test_unwrap_attachments.py
index 1c5fa86..3c8ac8b 100644
--- a/_pytest/test_unwrap_attachments.py
+++ b/_pytest/test_unwrap_attachments.py
@@ -153,6 +153,30 @@ import pytest
},
{
'input_message': {'attachments': [{
+ 'fallback': 'Fallback',
+ 'title_link': 'http://link',
+ }]},
+ 'input_text_before': "http://link",
+ 'output': "",
+ },
+ {
+ 'input_message': {'attachments': [{
+ 'fallback': 'Fallback',
+ 'from_url': 'http://link',
+ }]},
+ 'input_text_before': "http://link",
+ 'output': "",
+ },
+ {
+ 'input_message': {'attachments': [{
+ 'fallback': 'Fallback',
+ 'image_url': 'http://link',
+ }]},
+ 'input_text_before': "http://link",
+ 'output': "",
+ },
+ {
+ 'input_message': {'attachments': [{
'title': 'Title',
'fields': [{
'title': 'First field title',