mirror of https://github.com/caronc/apprise
added test cases
parent
3b9b4c84b4
commit
8fdf8ee690
|
@ -445,6 +445,12 @@ def test_plugin_telegram_general(mock_post):
|
|||
body='body', title='title', notify_type=NotifyType.INFO,
|
||||
attach=attach) is True
|
||||
|
||||
# Test large messages
|
||||
assert obj.notify(
|
||||
body='a' * (obj.telegram_caption_maxlen + 1),
|
||||
title='title', notify_type=NotifyType.INFO,
|
||||
attach=attach) is True
|
||||
|
||||
# An invalid attachment will cause a failure
|
||||
path = os.path.join(
|
||||
TEST_VAR_DIR, '/invalid/path/to/an/invalid/file.jpg')
|
||||
|
@ -453,6 +459,12 @@ def test_plugin_telegram_general(mock_post):
|
|||
body='body', title='title', notify_type=NotifyType.INFO,
|
||||
attach=path) is False
|
||||
|
||||
# Test large messages
|
||||
assert obj.notify(
|
||||
body='a' * (obj.telegram_caption_maxlen + 1),
|
||||
title='title', notify_type=NotifyType.INFO,
|
||||
attach=path) is False
|
||||
|
||||
obj = NotifyTelegram(bot_token=bot_token, targets=None)
|
||||
# No user detected; this happens after our firsst notification
|
||||
assert len(obj.targets) == 0
|
||||
|
|
Loading…
Reference in New Issue