diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2017-09-20 23:49:00 +0200 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2017-09-20 23:53:09 +0200 |
commit | 4556187df35b6bcbbff310ae68ac2ec4bfd9d8ad (patch) | |
tree | f818fdc3a67cba2f536f969a2daae05f7d165bf1 /_pytest | |
parent | deb9f11ad36cfebbee5b4f0783108433f67f6b56 (diff) | |
download | wee-slack-4556187df35b6bcbbff310ae68ac2ec4bfd9d8ad.tar.gz |
Don't render equal title_link and from_url in attachments twice
This is a follow-up of commit 0345ba1. That prevented rendering the link
if it already was in the text. This prevents rendering both the
title_link and from_url if they are equal, but not in the text. In this
case it only renders the title_link.
Diffstat (limited to '_pytest')
-rw-r--r-- | _pytest/test_unwrap_attachments.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/_pytest/test_unwrap_attachments.py b/_pytest/test_unwrap_attachments.py index e70256e..8b22515 100644 --- a/_pytest/test_unwrap_attachments.py +++ b/_pytest/test_unwrap_attachments.py @@ -45,6 +45,19 @@ import pytest { 'input_message': {'attachments': [{ 'title': 'Title', + 'text': 'Attachment text', + 'title_link': 'http://link', + 'from_url': 'http://link', + }]}, + 'input_text_before': "", + 'output': "\n".join([ + "Title (http://link)", + "Attachment text", + ]), + }, + { + 'input_message': {'attachments': [{ + 'title': 'Title', 'text': 'Attachment text\n\n\nWith multiple lines', }]}, 'input_text_before': "", |