piazza-api icon indicating copy to clipboard operation
piazza-api copied to clipboard

Tests with responses

Open hfaran opened this issue 11 years ago • 2 comments

Testing against the actual Piazza SaaS is likely more trouble than it's worth; such tests could be set up to tell us when piazza-api breaks against any future changes to the Piazza API, although.

That being said, testing against a static mock API using responses seems like a much better idea for the time being. This won't tell us when Piazza API changes break piazza-api against Piazza, but it will tell us when bad refactoring breaks piazza-api against the mockup.

hfaran avatar Nov 10 '14 09:11 hfaran

An easier solution might be using vcrpy. You can just set up a bunch of test cases using requests as you normally would and the responses from the API will be automatically saved and used when tests are rerun in the future.

michaelmior avatar Jan 31 '15 20:01 michaelmior

Thanks for the suggestion! I've heard of vcrpy but never used it; this sounds like a good opportunity to try it out though.

hfaran avatar Feb 01 '15 07:02 hfaran