diff --git a/tests/test_client.py b/tests/test_client.py new file mode 100644 index 0000000..654b894 --- /dev/null +++ b/tests/test_client.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from platform import platform + +from eventbrite import __version__ +from eventbrite.exceptions import InvalidResourcePath +from eventbrite.client import Eventbrite + +from .base import unittest, mock + + +def test_headers(): + eventbrite = Eventbrite('12345') + expected_headers = { + u'content-type': u'application/json', + u'Authorization': u'Bearer 12345', + u'User-Agent': "eventbrite-python-sdk {version} ({system})".format( + version=__version__, + system=platform(), + ) + } + assert eventbrite.headers == expected_headers + + +def test_headers_without_content_type(): + """Should not have content-type""" + eventbrite = Eventbrite('12345') + eventbrite.content_type_specified = False + expected_headers = { + u'Authorization': u'Bearer 12345', + u'User-Agent': "eventbrite-python-sdk {version} ({system})".format( + version=__version__, + system=platform(), + ) + } + assert eventbrite.headers == expected_headers