-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use httptest
for API mocking
#388
Comments
Hi @Aariq, thanks for looking into this, if you start working on API mocking I'll join in. What I'm wondering about is the advantage of Selecting the API: PubChem and ChemSpider are the slowest (many tests) and for ChemSpider there is also the monthly limit. I think ChemSpider would be the best candidate. |
The major downside of |
First, |
if you use httptest and then later switch from httr to httr2, it'll be very easy to switch to httptest2. |
Played around with |
@Aariq it's a reasonable choice but if the beginning of each file paths it's the same, you can edit the configuration. (you'd need httptest latest version as the former one had a bug nealrichardson/httptest#82)
Happy to help if needed, and absolutely no pressure to switch to httptest. |
Thanks @maelle. I did follow the guide to fix non-portable file paths and it just didn't go super smoothly. There are a lot of different API endpoints that |
I've played around with
httptest2
in theazmetr
package and it's relatively easy to get set up. I'm going to close #306 and this issue will replace it. I'd love to be able to carve out some time to work on this, but not sure when that'll happen. Maybe I can start things off with a small PR that just does one of the APIs as an example. What's the slowest API in terms of testing?The text was updated successfully, but these errors were encountered: