Closed maelle closed 3 years ago
They're in inst
so that they're installed with the package. That way, packages that depend on your API-wrapping package can write tests safely and consistently and not leak auth secrets. Perhaps not a problem for many, but it was a problem I had at the time of writing this feature.
Why can't the the redactor and request function be defined in the helper.R instead?
They totally can be using set_requester()
/set_redactor()
, if you prefer that way and aren't concerned about packages depending on yours.
Oooh I see. Any example I could refer to?
At the time I was developing the crunch package that wrapped the platform's API, and then crplyr on top of that that implemented dplyr
methods. In the redactor for crunch
, it does things like truncate long UUIDs and otherwise handles quirks of the Crunch HTTP API underneath. crplyr
uses the same API so it made sense that it would use the same redactor, and it seemed like the responsibility of the "official" API wrapping package to own how to test/sanitize its API.
(Disclaimer: I haven't been involved with these packages for the last year and a half, so I can't say with certainty how they work now, but it appears they're still generally set up the same.)
Can I close this, or are there docs that should be updated to capture this discussion?
we can close this, sorry and thank you!!
When setting up httptest one needs to tweak
Why can't the the redactor and request function be defined in the helper.R instead? Alternatively, could use_httptest() create them even if they're empty?