def test_create_for_channel_client_token(self): c = push.WebhookChannel('http://example.org') s = push.Subscription.for_channel(c, client_token='my_token') self.assertEqual('my_token', s.client_token) assertUrisEqual(self, 'web_hook?url=http%3A%2F%2Fexample.org&app_engine=false', s.subscribe)
def test_create_for_channel_client_token(self): c = push.WebhookChannel('http://example.org') s = push.Subscription.for_channel(c, client_token='my_token') self.assertEqual('my_token', s.client_token) assertUrisEqual( self, 'web_hook?url=http%3A%2F%2Fexample.org&app_engine=false', s.subscribe)
def test_update_query_params_existing_params(self): uri = 'http://www.google.com?x=y' updated = _update_query_params(uri, {'a': 'b', 'c': 'd&'}) hardcoded_update = uri + '&a=b&c=d%26' assertUrisEqual(self, updated, hardcoded_update)
def test_creation_appengine(self): c = push.WebhookChannel('http://example.org', app_engine=True) assertUrisEqual(self, 'web_hook?url=http%3A%2F%2Fexample.org&app_engine=true', c.as_header_value())
def test_creation_appengine(self): c = push.WebhookChannel('http://example.org', app_engine=True) assertUrisEqual( self, 'web_hook?url=http%3A%2F%2Fexample.org&app_engine=true', c.as_header_value())