def test_host_should_be_text(self): NotificationClient(app_id=u'4', key=u'key', secret=u'secret', ssl=True, host=u'foo') self.assertRaises( TypeError, lambda: NotificationClient( app_id=u'4', key=u'key', secret=u'secret', ssl=True, host=4))
def __init__(self, app_id, key, secret, ssl=True, host=None, port=None, timeout=5, cluster=None, encryption_master_key=None, json_encoder=None, json_decoder=None, backend=None, notification_host=None, notification_ssl=True, **backend_options): self._pusher_client = PusherClient(app_id, key, secret, ssl, host, port, timeout, cluster, encryption_master_key, json_encoder, json_decoder, backend, **backend_options) self._authentication_client = AuthenticationClient( app_id, key, secret, ssl, host, port, timeout, cluster, encryption_master_key, json_encoder, json_decoder, backend, **backend_options) self._notification_client = NotificationClient( app_id, key, secret, notification_ssl, notification_host, port, timeout, cluster, json_encoder, json_decoder, backend, **backend_options)
def test_notify_supplied_ssl_and_host(self): configured_client = NotificationClient(app_id='6', key='woo', secret='shhh', ssl=False, host='foo.bar.io') request = configured_client.notify.make_request([u'blargh'], self.success_fixture) self.assertEqual(request.base_url, u'http://foo.bar.io:80')
def setUp(self): self.client = NotificationClient(app_id='4', key='key', secret='secret') self.success_fixture = { 'webhook_url': 'http://webhook.com', 'apns': { 'alert': { 'title': 'yolo', 'body': 'woot' } }, 'gcm': { 'notification': { 'title': 'yipee', 'icon': 'huh' } } }