-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for #19, now all GET requests lack content type
- Loading branch information
Daniel Greenfeld
committed
Apr 24, 2015
1 parent
b840e1b
commit a9f6a09
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |