Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Cassette stores and replays HTTP requests made in your Python app.
.. code:: python
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)
Cassette also supports the requests <https://github.com/kennethreitz/requests>
_
library.
.. code:: python
import requests
with cassette.play("data/responses.yaml"):
r = requests.get("http://www.internic.net/domain/named.root")
Note that requests stored between different libraries may not be compatible with
each other. That is, a request stored with urllib2
might still trigger an external
request is the same URL is requested with requests
.
.. code-block:: sh
$ pip install cassette
Latest documentation: cassette.readthedocs.org <http://cassette.readthedocs.org/>
_
cassette is available under the MIT License.
Copyright Uber 2013, Charles-Axel Dein charles@uber.com
FAQs
Cassette stores and replays HTTP requests.
We found that cassette demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.