Open teotenn opened 1 year ago
There is handling for write_disk: https://github.com/nealrichardson/httptest/blob/main/R/capture-requests.R#L168-L180
Here is where it is tested: https://github.com/nealrichardson/httptest/blob/main/tests/testthat/test-capture-requests.R#L1-L76
The tests check that you can get the content()
of a disk-backed response, but I don't recall whether it moves the mock file into the file path given to write_disk()
, so it's possible that's not covered. I'm not sure whether that's the intended way to access responses in httr, or whether you should always use content()
. Happy to consider a change if one is needed.
Hi, I am trying to test a function that uses
GET
but we are mainly focused on its side effect ofwrite_disk()
. In short, the following piece of code should write the file to a particular location and then process it furtherIf I execute the code above the file will be written to
getwd()
under the nametmp_file
. But when I execute it insidewith_mock_api
I cannot find thetmp_file
anywere and thus, my function cannot continue.Is there a way to work around that?
I've been reading the code and searching in the issue but I cannot figure it out.