Metadata-Version: 1.1
Name: cassette
Version: 0.1.5
Summary: Cassette is a testing tool that stores external HTTP request in YAML file.
Home-page: https://github.com/uber/cassette
Author: Charles-Axel Dein
Author-email: charles@uber.com
License: UNKNOWN
Description: ['########\n', 'cassette\n', '########\n', '\n', '-  The first time you run your tests, ``cassette`` will store all the\n', '   external requests response in a YAML file.\n', '-  Next time you run your tests, ``cassette`` will fetch those responses\n', '   from the YAML file. You can now run your tests while being offline.\n', '\n', '.. code:: python\n', '\n', '    import urllib2\n', '\n', '    import cassette\n', '\n', '\n', '    def test_get_root_domains():\n', '        """Get the root domains."""\n', '\n', '        with cassette.play("data/responses.yaml"):\n', '\n', '            # If the request is not already stored in responses.yaml, cassette\n', '            # will request the URL and store its response in the file.\n', '            r = urllib2.urlopen("http://www.internic.net/domain/named.root")\n', '\n', '            # This time, the request response must be in the file. The external\n', '            # request is not made. cassette retrieves the response from the\n', '            # file.\n', '            r = urllib2.urlopen("http://www.internic.net/domain/named.root")\n', '\n', '        assert "A.ROOT-SERVERS.NET" in r.read(10000)\n', '\n', 'Installation\n', '============\n', '\n', 'Locally:\n', '\n', '::\n', '\n', '    $ python setup.py develop\n', '\n', 'Via PyPi:\n', '\n', '::\n', '\n', '    $ pip install cassette\n', '\n', 'Usage\n', '=====\n', '\n', 'cassette provides a ``play`` context:\n', '\n', '.. code:: python\n', '\n', '    import cassette\n', '\n', '    with cassette.play("./data/responses.yaml"):\n', '        urllib2.urlopen("http://...")\n', '\n', 'Any ``urllib2.urlopen`` request happening in this context will go\n', "through cassette's mocked version of ``urlopen``.\n", '\n', 'You can also setup the context manually:\n', '\n', '.. code:: python\n', '\n', '    import cassette\n', '\n', '    cassette.insert("./data/responses.yaml")\n', '    urllib2.urlopen("http://...")\n', '    cassette.eject()\n', '\n', 'Running cassette tests\n', '======================\n', '\n', 'Install requirements:\n', '\n', '::\n', '\n', '    $ pip install -r requirements-dev.txt\n', '\n', 'Run tests:\n', '\n', '::\n', '\n', '    $ fab test\n', '\n', 'Similar libraries\n', '=================\n', '\n', '-  `vcrpy <https://github.com/kevin1024/vcrpy>`__: great library but you\n', '   can store only one request per YAML file...\n', '-  `vcr <https://github.com/myronmarston/vcr>`__: in Ruby\n', '\n', 'Limitations\n', '===========\n', '\n', 'This package should be considered **alpha**:\n', '\n', '-  Only tested with ``urllib2``\n', '-  Should not work with ``urllib`` and ``requests``\n', '-  The format used is not compatible with ``vcr`` or ``vcrpy``\n', '-  Only tested with Python 2.7\n', '-  File format may change.\n', '\n', 'License\n', '=======\n', '\n', 'cassette is available under the MIT License.\n']
Keywords: http,tests,mock
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Programming Language :: Python
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Testing
Classifier: Topic :: Software Development :: Libraries :: Python Modules
