From a9f6a097210449b8001e0bd3324eb5ffb6f30aaf Mon Sep 17 00:00:00 2001 From: Daniel Greenfeld Date: Fri, 24 Apr 2015 13:05:20 -0700 Subject: [PATCH] Fix for #19, now all GET requests lack content type --- tests/test_client.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/test_client.py 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