nealrichardson / httptest2

Utilities for testing R 📦s that use httr2
https://enpiar.com/httptest2/
Other
26 stars 6 forks source link

Redacting needs to be able to alter mock file path #8

Closed nealrichardson closed 2 years ago

nealrichardson commented 2 years ago

See test-redact.R. This was possible in httptest because the httr response object contains the request object, and the mock file path was generated off of that after redactors were applied. But in the current adaptation here, the file path is passed into save_response() as an argument because the httr2_response does not contain the request. So the redacting happens after the file path is generated.