amazon-product-api icon indicating copy to clipboard operation
amazon-product-api copied to clipboard

Adding new tests for CartCreate

Open donovanh opened this issue 9 years ago • 2 comments

I've forked this and added a "CartCreate" option here: https://github.com/donovanh/amazon-product-api

Having some trouble with the tests though - I think it could be a throttling issue as it hits Amazon's API repeatedly, so I'm seeing random fails and can't get the tests to run successfully. Do you think it could be worth faking the API requests and design the tests against a static definition of what the API expects, rather than have the tests test the API itself?

Feels to me that it would be efficient to test the code in isolation by abstracting the API calls.

donovanh avatar Jan 15 '16 09:01 donovanh

Hey @donovanh! Low API rate limit is a known issue https://github.com/t3chnoboy/amazon-product-api/issues/37 As for the tests, I agree, since the api is stable and has versioning, we can mock it.

t3chnoboy avatar Jan 15 '16 10:01 t3chnoboy

I think we should use fixtures and mock the API calls during in test. I created an issue for that #60.

masterT avatar Sep 15 '16 15:09 masterT