Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for AternateVersions Response group #135

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ThomasProctor
Copy link

Adds support for another response group. Part of the long slog to add support for #60.

I modeled this on how we support the "Images" response group. I'm not sure if it's the right way to do it, but I figured I should be consistent with the current API.

Here's some example usage:

In [11]: lookup_result = amazon.lookup(ItemId="1491914254", ResponseGroup='AlternateVersions')

In [12]: lookup_result.alternate_versions
Out[12]: 
[{'asin': '9352136047',
  'binding': 'Paperback',
  'title': "Deep Learning: A Practitioner's Approach"},
 {'asin': 'B074D5YF1D',
  'binding': 'Kindle Edition',
  'title': "Deep Learning: A Practitioner's Approach"}]

@ThomasProctor
Copy link
Author

ThomasProctor commented Mar 28, 2018

Some tests fail, as it looks like some of the info on products they query has changed. I opened an issue #134. All product-specific information should probably be removed from the tests. Instead, tests should just do type checks and check that the product information is present, and ignore what the specific value of that product information is.

@ThomasProctor
Copy link
Author

ThomasProctor commented Mar 29, 2018

Sorry about not opening a separate branch - I fixed an error in how browse_node_lookup handles invalid BrowseNodeIds. It turns out that the IsValid parameter does not, in fact, tell if the browse node id is valid. Instead, I had it check to see if any errors are made by the request. This was the bug highlighted by Issue #113.

Some pep8 white space changes in the test file got put in as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants