Added Google Firebase Cloud Messaging (FCM) Support (#329)

This commit is contained in:
Chris Caron
2020-12-23 14:56:28 -05:00
committed by GitHub
parent f68c414801
commit 83e3fdc048
5 changed files with 336 additions and 10 deletions

View File

@ -593,6 +593,61 @@ TEST_URLS = (
'test_requests_exceptions': True,
}),
##################################
# NotifyFCM
##################################
('fcm://', {
# We failed to identify any valid authentication
'instance': TypeError,
}),
('fcm://:@/', {
# We failed to identify any valid authentication
'instance': TypeError,
}),
('fcm://apikey/', {
# no project id specified
'instance': TypeError,
}),
('fcm://project@%20%20/', {
# invalid apikey
'instance': TypeError,
}),
('fcm://project@apikey/', {
# No targets specified; we will initialize but not notify anything
'instance': plugins.NotifyFCM,
'notify_response': False,
}),
('fcm://project@apikey/device', {
# Valid device
'instance': plugins.NotifyFCM,
'privacy_url': 'fcm://project@a...y/device',
}),
('fcm://project@apikey/#topic', {
# Valid topic
'instance': plugins.NotifyFCM,
'privacy_url': 'fcm://project@a...y/%23topic',
}),
('fcm://project@apikey/#topic1/device/%20/', {
# Valid topic, valid device, and invalid entry
'instance': plugins.NotifyFCM,
}),
('fcm://project@apikey?to=#topic1,device', {
# Test to=
'instance': plugins.NotifyFCM,
}),
('fcm://project@apikey/#topic1/device/', {
'instance': plugins.NotifyFCM,
# throw a bizzare code forcing us to fail to look it up
'response': False,
'requests_response_code': 999,
}),
('fcm://project@apikey/#topic1/device/', {
'instance': plugins.NotifyFCM,
# Throws a series of connection and transfer exceptions when this flag
# is set and tests that we gracfully handle them
'test_requests_exceptions': True,
}),
##################################
# NotifyFlock
##################################