How best to test external tool hitting foreman api?

I am working on adding more docker registry api endpoints to foreman (to allow docker push for example) and am wondering how best to test this.

I could run the tests on a live server, using ansible to make sure versions of tools such as docker and skopeo are present.

I was wondering, though, if there might be a way to use vcr[1] to record the incoming calls to the foreman api. Then in non-recording mode I could play that cassette instead of running the command. In this way I could have multiple cassettes for different versions of the external tools as well. Has anyone done something like this?

[1] https://github.com/vcr/vcr