Closed stuartleeks closed 2 months ago
One question around this is how to test the record mode.
After speaking with @tanya-borisova I think the simplest route forward is to have a very simple api for testing that has hard-coded responses for the required endpoints to pretend to be OpenAI (or other endpoints needed). This can be started for tests and the simulator can be pointed to that when it needs to forward requests.
@tanya-borisova also pointed me to https://pypi.org/project/pytest_httpserver/ which could also work if running the simulator directly from the tests via uvicorn.run
(rather than spinning up via a separate process)
There are currently a lack of automated tests - this should be remedied!
The goal is to provide an easy way to exercise the key aspects of the simulator (e.g. record/replay, generator, hooks, rate-limiting).
Tests: