PyROS (Python Rest from Oas Simulator) is a generic REST server simulator that consumes OAS (Open API Spec) files to dynamically generate a mock HTTP server. It is also capable of adding additional endpoints manually, and can be primed with custom responses for any existing endpoint (including both custom HTTP code and json body). PyROS is designed to be used to mock REST interfaces in software testing, and as such comes with some useful behave step definitions.
For documentation on the REST API to control PyROS, please see the postman collection at PyROS.postman_collection.json.
PyROS is designed to be ran in a docker container, to allow portability and ease of access between projects. As such, whilst in root, we can build PyROS using the command:
docker compose build pyros
and then, after building, run PyROS server by using the command:
docker compose up pyros
and then, after running PyROS server, if you want to see the GUI dashborad to access the PyROS, run by using the command:
docker exec -it pyros bash & ./scripts/start_pyros_gui.sh
In the future, this could be developed further by adding PyROS as an image to artifactory and instead of building PyROS each time, we can just pull the latest version.