Skip to content

Commit

Permalink
fix cn test to fit python2/3
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Nov 17, 2015
1 parent 5b6ee52 commit db000bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions habanero/cnrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ def make_request(url, ids, format, style, locale, **kwargs):

if format == "citeproc-json":
url = "http://api.crossref.org/works/" + ids + "/" + type
return requests.get(url, headers = head, allow_redirects = True, **kwargs).content
return requests.get(url, headers = head, allow_redirects = True, **kwargs).text
else:
if format == "text":
type = type + "; style = " + style + "; locale = " + locale
url = url + "/" + ids
return requests.get(url, headers = head, allow_redirects = True, **kwargs).content
return requests.get(url, headers = head, allow_redirects = True, **kwargs).text

5 changes: 2 additions & 3 deletions test/test-content_negotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
def test_content_negotiation():
"content negotiation - deafult - bibtex"
res = cn.content_negotiation(ids = '10.1126/science.169.3946.635')
assert str == res.__class__
assert str == str(res).__class__

def test_content_negotiation_citeproc_json():
"content negotiation - citeproc-json"
res = cn.content_negotiation(ids = '10.1126/science.169.3946.635', format = "citeproc-json")
assert str == res.__class__
assert cjson == res
assert str == str(res).__class__

0 comments on commit db000bc

Please sign in to comment.