Skip to content

Commit

Permalink
Alter test attachment doc link mode
Browse files Browse the repository at this point in the history
This causes tests related to #75 to pass again
  • Loading branch information
urschrei committed Jan 30, 2018
1 parent 6f2a78a commit c8ebe82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyzotero/zotero.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def wrapped_f(self, *args, **kwargs):
# is this a snapshot though?
retr = retrieved.json()
# I know, I know
if isinstance(retr, dict) and retr['data']['linkMode'] == u"imported_url":
if isinstance(retr, dict) and retr.get('data', {}).get('linkMode', {}) == u"imported_url":
return retrieved.content
else:
return retr
Expand Down
2 changes: 1 addition & 1 deletion test/api_responses/attachments_doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"itemType": "attachment",
"title": "1641 Depositions",
"accessDate": "2012-01-11T19:54:47Z",
"linkMode": "imported_url",
"linkMode": "idk",
"charset": "utf-8",
"relations": {},
"filename": "project-conservation.html",
Expand Down

0 comments on commit c8ebe82

Please sign in to comment.