Skip to content

kevin1024/cassette

 
 

Repository files navigation

Cassette

Cassette stores and replays HTTP requests made in your Python app.

import urllib2

import cassette

with cassette.play("data/responses.yaml"):

    # If the request is not already stored in responses.yaml, cassette
    # will request the URL and store its response in the file.
    r = urllib2.urlopen("http://www.internic.net/domain/named.root")

    # This time, the request response must be in the file. The external
    # request is not made. cassette retrieves the response from the
    # file.
    r = urllib2.urlopen("http://www.internic.net/domain/named.root")

assert "A.ROOT-SERVERS.NET" in r.read(10000)

Installation

$ pip install cassette

Documentation

Latest documentation: uber.github.io/cassette/

License

cassette is available under the MIT License.

Copyright Uber 2013, Charles-Axel Dein <charles@uber.com>

About

Store and replay HTTP requests made in your Python app

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 84.6%
  • Shell 15.4%