mirror of
https://github.com/caronc/apprise.git
synced 2025-08-09 00:15:03 +02:00
Added DingTalk Support (#200)
This commit is contained in:
@ -260,6 +260,71 @@ TEST_URLS = (
|
||||
'test_requests_exceptions': True,
|
||||
}),
|
||||
|
||||
##################################
|
||||
# NotifyDingTalk
|
||||
##################################
|
||||
('dingtalk://', {
|
||||
# No Access Token specified
|
||||
'instance': TypeError,
|
||||
}),
|
||||
('dingtalk://a_bd_/', {
|
||||
# invalid Access Token
|
||||
'instance': TypeError,
|
||||
}),
|
||||
('dingtalk://12345678', {
|
||||
# access token
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
|
||||
# Our expected url(privacy=True) startswith() response:
|
||||
'privacy_url': 'dingtalk://1...8',
|
||||
}),
|
||||
('dingtalk://{}/{}'.format('a' * 8, '1' * 14), {
|
||||
# access token + phone number
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
}),
|
||||
('dingtalk://{}/{}/invalid'.format('a' * 8, '1' * 3), {
|
||||
# access token + 2 invalid phone numbers
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
}),
|
||||
('dingtalk://{}/?to={}'.format('a' * 8, '1' * 14), {
|
||||
# access token + phone number using 'to'
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
}),
|
||||
# Test secret via user@
|
||||
('dingtalk://secret@{}/?to={}'.format('a' * 8, '1' * 14), {
|
||||
# access token + phone number using 'to'
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
# Our expected url(privacy=True) startswith() response:
|
||||
'privacy_url': 'dingtalk://****@a...a',
|
||||
}),
|
||||
# Test secret via secret= and token=
|
||||
('dingtalk://?token={}&to={}&secret={}'.format(
|
||||
'b' * 8, '1' * 14, 'a' * 15), {
|
||||
# access token + phone number using 'to'
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
'privacy_url': 'dingtalk://****@b...b',
|
||||
}),
|
||||
# Invalid secret
|
||||
('dingtalk://{}/?to={}&secret=_'.format('a' * 8, '1' * 14), {
|
||||
'instance': TypeError,
|
||||
}),
|
||||
('dingtalk://{}?format=markdown'.format('a' * 8), {
|
||||
# access token
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
}),
|
||||
('dingtalk://{}'.format('a' * 8), {
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
# throw a bizzare code forcing us to fail to look it up
|
||||
'response': False,
|
||||
'requests_response_code': 999,
|
||||
}),
|
||||
('dingtalk://{}'.format('a' * 8), {
|
||||
'instance': plugins.NotifyDingTalk,
|
||||
# Throws a series of connection and transfer exceptions when this flag
|
||||
# is set and tests that we gracfully handle them
|
||||
'test_requests_exceptions': True,
|
||||
}),
|
||||
|
||||
##################################
|
||||
# NotifyDiscord
|
||||
##################################
|
||||
|
Reference in New Issue
Block a user