Skip to content

Commit

Permalink
Got Webhooks working with the API
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Greenfeld committed Aug 11, 2015
1 parent 8dcede0 commit 54562de
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
18 changes: 18 additions & 0 deletions eventbrite/apiv3_url_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,23 @@
"response_type": "single_response",
"serializer": "MobileDevice",
"url_regexp": "^devices/me/$"
},
{
"data_type": "serialized",
"response_type": "single_response",
"serializer": "Webhook",
"url_regexp": "^webhooks/$"
},
{
"data_type": "serialized",
"response_type": "single_response",
"serializer": "Webhook",
"url_regexp": "^webhooks/(?P<id>\\d+)/$"
},
{
"data_type": "serialized",
"response_type": "single_response",
"serializer": "Webhook",
"url_regexp": "^webhooks/(?P<id>\\d+)/delete/$"
}
]
19 changes: 19 additions & 0 deletions tests/integration/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,22 @@ def test_get_event_expansions(self):
evbobject = self.eventbrite.get_event(
'11260994939', expand='ticket_classes')
self.assertTrue('ticket_classes' in evbobject)


class TestCRUDWebhooks(unittest.TestCase):

def setUp(self):
self.eventbrite = Eventbrite(OAUTH_TOKEN)

@unittest.skipIf(
condition=skip_integration_tests,
reason='Needs an OAUTH_TOKEN')
def test_basic_webhook(self):
data = dict(
endpoint_url='http://example.com',
actions='',
event_id='15562735561'
)
response = self.eventbrite.post_webhooks(**data)
self.assertTrue(response.ok)
self.assertEqual(response['event_id'], '15562735561')

0 comments on commit 54562de

Please sign in to comment.