Closed MarkEdmondson1234 closed 6 years ago
Thanks for the report, Mark. capture_requests
works using the base::trace()
function, which is something of a dark art. I suspect the problem is that the httr::RETRY()
method isn't being traced, and that's how your function is making its requests. I'll start there and add support for that (and your timing is good as I'm looking to make a new httptest
release shortly).
If you want an immediate workaround, I suspect if you changed https://github.com/MarkEdmondson1234/googleAuthR/blob/af4102c2f1518f6a7e413bf727f85be8af5e69ec/R/generator.R#L330-L332 to
req <- retryRequest(do.call(arg_list$verb
args = arg_list[names(arg_list) != "verb"],
envir = asNamespace("httr")))
it would directly call POST
, the capture_requests
tracing would kick in, and you'd get your mocks recorded. (If so, that would also confirm the lack of RETRY()
support as the only issue in httptest
to fix.)
Ok, I believe this issue is resolved with that change to support RETRY()
. Please let me know if it does not address everything for you.
Thanks, all working now!
Hi Neal!
I'm updating some tests and noticed that none of the mock files are being written, so giving failures when using
with_mock_API()
My example:
which gives: