Skip to content

Commit

Permalink
Cover the other webhooks.
Browse files Browse the repository at this point in the history
  • Loading branch information
iurisilvio committed Dec 11, 2014
1 parent 2703680 commit 46f74a7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests.py
Expand Up @@ -163,14 +163,16 @@ def setUp(self):
self.app.debug = True
self.app.config["PUSHER_KEY"] = "KEY"
self.app.config["PUSHER_SECRET"] = "SUPERSECRET"
self.pusher = Pusher(self.app)
self.pusher = Pusher()
self.client = self.app.test_client()
self._called = False

@self.pusher.webhooks.client
def c():
self._called = True

self.pusher.init_app(self.app)

def test_no_webhook(self):
with self.app.test_request_context():
url = url_for("pusher.presence_event")
Expand Down Expand Up @@ -229,5 +231,15 @@ def test_valid_signature(self):
self.assertEqual(200, response.status_code)
self.assertTrue(self._called)

def test_hook_all_handlers(self):
@self.pusher.webhooks.presence
def h1():
pass

@self.pusher.webhooks.channel_existence
def h2():
pass


if __name__ == '__main__':
unittest.main()

0 comments on commit 46f74a7

Please sign in to comment.