mirror of
https://github.com/caronc/apprise.git
synced 2025-08-10 00:38:02 +02:00
SimplePush Support (#146)
This commit is contained in:
@ -2029,6 +2029,64 @@ TEST_URLS = (
|
||||
'test_requests_exceptions': True,
|
||||
}),
|
||||
|
||||
##################################
|
||||
# NotifySimplePush
|
||||
##################################
|
||||
('spush://', {
|
||||
# No api key
|
||||
'instance': None,
|
||||
}),
|
||||
('spush://{}'.format('A' * 14), {
|
||||
# API Key specified however expected server response
|
||||
# didn't have 'OK' in JSON response
|
||||
'instance': plugins.NotifySimplePush,
|
||||
# Expected notify() response
|
||||
'notify_response': False,
|
||||
}),
|
||||
('spush://{}'.format('X' * 14), {
|
||||
# API Key valid and expected response was valid
|
||||
'instance': plugins.NotifySimplePush,
|
||||
# Set our response to OK
|
||||
'requests_response_text': {
|
||||
'status': 'OK',
|
||||
},
|
||||
}),
|
||||
('spush://{}?event=Not%20So%20Good'.format('X' * 14), {
|
||||
# API Key valid and expected response was valid
|
||||
'instance': plugins.NotifySimplePush,
|
||||
# Set our response to something that is not okay
|
||||
'requests_response_text': {
|
||||
'status': 'NOT-OK',
|
||||
},
|
||||
# Expected notify() response
|
||||
'notify_response': False,
|
||||
}),
|
||||
('spush://salt:pass@{}'.format('X' * 14, 'A' * 16), {
|
||||
# Now we'll test encrypted messages with new salt
|
||||
'instance': plugins.NotifySimplePush,
|
||||
# Set our response to OK
|
||||
'requests_response_text': {
|
||||
'status': 'OK',
|
||||
},
|
||||
}),
|
||||
('spush://{}'.format('Y' * 14), {
|
||||
'instance': plugins.NotifySimplePush,
|
||||
# throw a bizzare code forcing us to fail to look it up
|
||||
'response': False,
|
||||
'requests_response_code': 999,
|
||||
# Set a failing message too
|
||||
'requests_response_text': {
|
||||
'status': 'BadRequest',
|
||||
'message': 'Title or message too long',
|
||||
},
|
||||
}),
|
||||
('spush://{}'.format('Z' * 14), {
|
||||
'instance': plugins.NotifySimplePush,
|
||||
# Throws a series of connection and transfer exceptions when this flag
|
||||
# is set and tests that we gracfully handle them
|
||||
'test_requests_exceptions': True,
|
||||
}),
|
||||
|
||||
##################################
|
||||
# NotifySlack
|
||||
##################################
|
||||
|
Reference in New Issue
Block a user