Skip to content

Commit

Permalink
Added test for set_webhook_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
JosXa committed Jan 21, 2018
1 parent 3f44ec6 commit 4b45fe6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,19 @@ def test_page_info(self):

self.assertEquals(2, self.page._fetch_page_info.call_count)

def test_set_webhook_handler(self):

def dummy_func():
pass

with self.assertRaises(ValueError):
self.page.set_webhook_handler("shouldfail", dummy_func)

self.page.set_webhook_handler("message", dummy_func)
self.assertEqual(self.page._webhook_handlers["message"], dummy_func)

# clean up
self.page._webhook_handlers["message"] = None

def test_handle_webhook_message(self):
payload = """
Expand Down

0 comments on commit 4b45fe6

Please sign in to comment.