summaryrefslogtreecommitdiff
path: root/tests/test_telegram.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_telegram.py')
-rw-r--r--tests/test_telegram.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_telegram.py b/tests/test_telegram.py
index 0b3dbdc..b9f3e44 100644
--- a/tests/test_telegram.py
+++ b/tests/test_telegram.py
@@ -48,6 +48,17 @@ def test_basic():
styles = [('spoiler', 11, 10, '')]
assert(format_for_telegram(test) == (formatted_body, styles))
+def test_basic_mention():
+ test = "SavagePeanut _underline_"
+ formatted_body = "SavagePeanut underline"
+ styles = [('mention', 0, 12, ''), ('italics', 13, 9, '')]
+ assert(format_for_telegram(test, [("SavagePeanut", 0, 12)]) == (formatted_body, styles))
+
+ test = "*bold* SavagePeanut"
+ formatted_body = "bold SavagePeanut"
+ styles = [('bold', 0, 4, ''), ('mention', 5, 12, '')]
+ assert(format_for_telegram(test, [("SavagePeanut", 7, 19)]) == (formatted_body, styles))
+
def test_quotes():
test = ">single"
formatted_body = ">single"