Skip to content

Commit

Permalink
Fix for #19, now all GET requests lack content type
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Greenfeld committed Apr 24, 2015
1 parent b840e1b commit a9f6a09
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a9f6a09

Please sign in to comment.