algolia / algoliasearch-client-python

⚡️ A fully-featured and blazing-fast Python API client to interact with Algolia.
https://www.algolia.com/doc/api-client/getting-started/install/python/?language=python
MIT License
196 stars 67 forks source link

feat(recommend): add client #539

Closed shortcuts closed 2 years ago

shortcuts commented 2 years ago
Q A
Bug fix? yes
New feature? yes
BC breaks? no
Related Issue Fixes https://github.com/algolia/algoliasearch-client-python/issues/537
Need Doc update yes

Describe your change

This PR introduces the Recommend client with the following methods:

shortcuts commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

last check before mergning? @tkrugg @DevinCodes :D