diff --git a/eventbrite/apiv3_url_mapping.json b/eventbrite/apiv3_url_mapping.json index bfd1af4..b59ddfa 100644 --- a/eventbrite/apiv3_url_mapping.json +++ b/eventbrite/apiv3_url_mapping.json @@ -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\\d+)/$" + }, + { + "data_type": "serialized", + "response_type": "single_response", + "serializer": "Webhook", + "url_regexp": "^webhooks/(?P\\d+)/delete/$" } ] diff --git a/tests/integration/test_client.py b/tests/integration/test_client.py index 1db601a..70870ae 100644 --- a/tests/integration/test_client.py +++ b/tests/integration/test_client.py @@ -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')