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.2.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.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vcr-stub-server-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 5ebe8801066a1bcef2893ed85b71e78046cb2ed4ed913a50753142ec8986fa0e
MD5 cfad42874a76f559d1b0678e60fc1dc3
BLAKE2b-256 f2dcd90573bccb3538095628ea9ce916e80f76c7c2ab020651ec6a4466f7bfae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vcr_stub_server-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69182c313a0dd189b41192028d8eb7114b05ca843c38b246b07e4ffc149ed53c
MD5 50678d817306d09155262e4e1565913c
BLAKE2b-256 7a0d6236bd521037eaf8c953ab7cbd41cea75cf5ddfbc8d5c847fcb8a8ee070e

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