Since the VCR stuff is concerned with testing, can the VCR-related code just appear in the test files, rather than here in the main codebase?
I don't know how the go version of VCR is set up, but in the python version I create a 'context' for whatever functions or methods I'm testing within the test itself, e.g.
with vcr.use_cassette(
"test/data/cassettes/fetch_objects_by_ref.yaml"
):
output = data_fetcher.fetch_objects_by_ref(ref_list)
All the VCR settings are configured within the test suite and VCR is only active when the tests are running. The python VCR has request-matching capabilities so I can store the responses from a series of requests in a single file and the VCR module returns the appropriate response for the given request.
@ialarmedalien sez (in #52):
Since the VCR stuff is concerned with testing, can the VCR-related code just appear in the test files, rather than here in the main codebase?
I don't know how the go version of VCR is set up, but in the python version I create a 'context' for whatever functions or methods I'm testing within the test itself, e.g.
All the VCR settings are configured within the test suite and VCR is only active when the tests are running. The python VCR has request-matching capabilities so I can store the responses from a series of requests in a single file and the VCR module returns the appropriate response for the given request.