mirror of
https://github.com/caronc/apprise.git
synced 2025-08-09 08:25:07 +02:00
Added OneSignal Support (#335)
This commit is contained in:
@ -2319,6 +2319,83 @@ TEST_URLS = (
|
||||
'test_requests_exceptions': True,
|
||||
}),
|
||||
|
||||
##################################
|
||||
# NotifyOneSignal
|
||||
##################################
|
||||
('onesignal://', {
|
||||
# We failed to identify any valid authentication
|
||||
'instance': TypeError,
|
||||
}),
|
||||
('onesignal://:@/', {
|
||||
# We failed to identify any valid authentication
|
||||
'instance': TypeError,
|
||||
}),
|
||||
('onesignal://apikey/', {
|
||||
# no app id specified
|
||||
'instance': TypeError,
|
||||
}),
|
||||
('onesignal://appid@%20%20/', {
|
||||
# invalid apikey
|
||||
'instance': TypeError,
|
||||
}),
|
||||
('onesignal://appid@apikey/playerid/?lang=X', {
|
||||
# invalid language id (must be 2 characters)
|
||||
'instance': TypeError,
|
||||
}),
|
||||
('onesignal://appid@apikey/', {
|
||||
# No targets specified; we will initialize but not notify anything
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
'notify_response': False,
|
||||
}),
|
||||
('onesignal://appid@apikey/playerid', {
|
||||
# Valid playerid
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
'privacy_url': 'onesignal://a...d@a...y/playerid',
|
||||
}),
|
||||
('onesignal://appid@apikey/player', {
|
||||
# Valid player id
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
# don't include an image by default
|
||||
'include_image': False,
|
||||
}),
|
||||
('onesignal://appid@apikey/@user?image=no', {
|
||||
# Valid userid, no image
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
}),
|
||||
('onesignal://appid@apikey/user@email.com/#seg/player/@user/%20/a', {
|
||||
# Valid email, valid playerid, valid user, invalid entry (%20),
|
||||
# and too short of an entry (a)
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
}),
|
||||
('onesignal://appid@apikey?to=#segment,playerid', {
|
||||
# Test to=
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
}),
|
||||
('onesignal://templateid:appid@apikey/playerid', {
|
||||
# Test Template ID
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
}),
|
||||
('onesignal://appid@apikey/playerid/?lang=es&subtitle=Sub', {
|
||||
# Test Language and Subtitle Over-ride
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
}),
|
||||
('onesignal://?apikey=abc&template=tp&app=123&to=playerid', {
|
||||
# Test Kwargs
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
}),
|
||||
('onesignal://appid@apikey/#topic1/device/', {
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
# throw a bizzare code forcing us to fail to look it up
|
||||
'response': False,
|
||||
'requests_response_code': 999,
|
||||
}),
|
||||
('onesignal://appid@apikey/#topic1/device/', {
|
||||
'instance': plugins.NotifyOneSignal,
|
||||
# Throws a series of connection and transfer exceptions when this flag
|
||||
# is set and tests that we gracfully handle them
|
||||
'test_requests_exceptions': True,
|
||||
}),
|
||||
|
||||
##################################
|
||||
# NotifyParsePlatform
|
||||
##################################
|
||||
|
Reference in New Issue
Block a user