Open tedmielczarek-fastly opened 1 week ago
Depending on the level of configurability needed, we could even do something like embedding https://github.com/facebook/starlark-rust to allow viceroy "scripts" to handle creating responses.
For the purposes of mocking backends for tests I would personally prefer a solution that allows using a handler function alongside the existing code in the module.
When using viceroy as a test runner it would be helpful if there were a way to mock backend responses. The motivation for this is twofold:
I don't know the viceroy codebase well so I can't offer useful implementation suggestions, but from a user's perspective I can imagine a few ideas of solutions that would be useful:
--mock-backend=my-backend=some_function_name
.Either of these would provide enough functionality to address the two points in the motivation list above.