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

feat(recommend): add client #539

Merged
merged 6 commits into from
Oct 7, 2021
Merged

feat(recommend): add client #539

merged 6 commits into from
Oct 7, 2021

Conversation

shortcuts
Copy link
Member

@shortcuts shortcuts commented Sep 29, 2021

Q A
Bug fix? yes
New feature? yes
BC breaks? no
Related Issue Fixes #537
Need Doc update yes

Describe your change

This PR introduces the Recommend client with the following methods:

  • get_recommendations
  • get_related_products
  • get_frequently_bought_together

@shortcuts shortcuts force-pushed the feat/recommend-client branch from 6d0075b to 153f1ba Compare September 30, 2021 08:59
tkrugg
tkrugg previously approved these changes Sep 30, 2021
Copy link
Contributor

@DevinCodes DevinCodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of testing that the _transporter.retry gets called with the right parameters, do you think it would it be possible to test the actual request being created? This would allow us to reuse the request definitions for the common test suite we're working towards.

You can see the requests that need to be made in this PR for the Ruby client.

@shortcuts
Copy link
Member Author

do you think it would it be possible to test the actual request being created?

@DevinCodes I don't know Python enough to affirm it is. After the step I've tested, the hosts gets randomly assigned and the payload translated to a Request object before being sent. I feel like the assertion is close enough to the CTS but let me know if I should dig your suggestion.

@DevinCodes
Copy link
Contributor

@shortcuts I think you should be able to mock the requester (as you do the transporter rn), and then assert that the request object it gets passed contains the right values (method, path, body,...). I'm not entirely sure though, since I don't know enough Python as well 😅 Perhaps @tkrugg could point in the right direction here?

@shortcuts
Copy link
Member Author

last check before mergning? @tkrugg @DevinCodes :D

@shortcuts shortcuts requested review from DevinCodes and tkrugg October 7, 2021 07:56
@shortcuts shortcuts force-pushed the feat/recommend-client branch from 25f7c02 to 0560840 Compare October 7, 2021 08:48
Copy link
Contributor

@DevinCodes DevinCodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you @shortcuts !

@shortcuts shortcuts merged commit 4208b7f into master Oct 7, 2021
@shortcuts shortcuts deleted the feat/recommend-client branch October 7, 2021 14:48
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.

Recommend client
3 participants