This fails as testthat can't access my .Renviron. I also couldn't just pass the values directly because then they would be checked into git via the test_ file
My intial idea was just to supply fake credentials as the API doesn't actually need to be accessed
However, this causes httptest to think it doesn't have any requests recorded as it uses the url to build the path and these params get passed in to the GET url.
Maybe my FR here is to be able to override with_mock_api finding the json files automatically and just to be able to supply them directly? The data is there and works great, it's just a matter of pointing to the right path
FYI, I have cross-posted a version of this question to Stack Overflow
I've used
capture_requests
to record the output of an API call my package makesIn this example the API username and password are loaded via env variables
However, when I come to write the test
This fails as testthat can't access my
.Renviron
. I also couldn't just pass the values directly because then they would be checked into git via thetest_
fileMy intial idea was just to supply fake credentials as the API doesn't actually need to be accessed
However, this causes
httptest
to think it doesn't have any requests recorded as it uses the url to build the path and these params get passed in to the GET url.Maybe my FR here is to be able to override
with_mock_api
finding the json files automatically and just to be able to supply them directly? The data is there and works great, it's just a matter of pointing to the right path