Skip to main content

Standalone stub server for replaying VCR cassettes

Project description

vcr-stub-server

This is a small tool for setting up a lightweight stub server that replays previously recorded VCR cassettes.

Usually VCR is used internally while running the test suite. In that case, the library is responsible for intercepting HTTP requests.

But in some cases, it can be useful to be able to spin up a live HTTP server which given a preexisting VCR cassette, would respond to each request with its matching recorded response.

One such case might come when implementing usage of Pact, where vcr-stub-server can be used to prevent the provider service from making requests to external services during pact verification. This project was inspired by Pact's own Stub Service.

Caveats

Unfortunately, there is no one standard for cassette YAML files, each VCR implementation is different. For example, cassette YAML files created by VCR.py won't be compatible with YAML files created by the Ruby implementation of VCR, etc.

Therfore this tool currently only supports VCR.py, using the library's own implementation of parsing the YAML files.

Installation

pip install vcr-stub-server

Usage

Once the package is installed, use the vcr-stub-server command to spin up your stub server.

vcr-stub-server path/to/vcr_cassette.yml

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/thatguysimon/vcr-stub-server. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vcr-stub-server-0.1.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vcr_stub_server-0.1.3-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file vcr-stub-server-0.1.3.tar.gz.

File metadata

  • Download URL: vcr-stub-server-0.1.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.9 Darwin/16.7.0

File hashes

Hashes for vcr-stub-server-0.1.3.tar.gz
Algorithm Hash digest
SHA256 61b7f46e9087bff18f6400d54b8223da3cc3d8cd51720bb604ce5d880653e037
MD5 481bdd5c208393c2fa0209f34d9a8289
BLAKE2b-256 5af5f3d68d49bb5e04e9eedd8e9a468dc69035f69a92af24a4d67dea4c21966b

See more details on using hashes here.

File details

Details for the file vcr_stub_server-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: vcr_stub_server-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.6.9 Darwin/16.7.0

File hashes

Hashes for vcr_stub_server-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1bd4498a0217d1b4eb4a7efcda7087e4fe85811264865b1af328c7a83a55b82c
MD5 5c371cd41d72443829c3b819787ebad5
BLAKE2b-256 18d0516a3bfe829811ae6ce3861c0cc63acce8a1a9a849c1a931a5a13dcbbc9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page