{ "info": { "author": "Aron Griffis", "author_email": "aron@scampersand.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Build Tools" ], "description": "==============\nvcrpy-unittest\n==============\n\n|PyPI| |Build Status| |Coverage Report| |Python Versions| |Gitter|\n\nThis package provides ``VCRTestCase`` for simple integration between\n`VCR.py`_ and Python's venerable unittest_.\n\nInstallation\n------------\n\nInstall from PyPI_:\n\n.. code:: sh\n\n pip install vcrpy-unittest\n\nUsage\n-----\n\nInherit from ``VCRTestCase`` for automatic recording and playback of HTTP\ninteractions.\n\n.. code:: python\n\n from vcr_unittest import VCRTestCase\n import requests\n\n class MyTestCase(VCRTestCase):\n def test_something(self):\n response = requests.get('http://example.com')\n\nSimilar to how VCR.py returns the cassette from the context manager,\n``VCRTestCase`` makes the cassette available as ``self.cassette``:\n\n.. code:: python\n\n self.assertEqual(len(self.cassette), 1)\n self.assertEqual(self.cassette.requests[0].uri, 'http://example.com')\n\nBy default cassettes will be placed in the ``cassettes`` subdirectory next to the\ntest, named according to the test class and method. For example, the above test\nwould read from and write to ``cassettes/MyTestCase.test_something.yaml``\n\nThe configuration can be modified by overriding methods on your subclass:\n``_get_vcr_kwargs``, ``_get_cassette_library_dir`` and ``_get_cassette_name``.\nTo modify the ``VCR`` object after instantiation, for example to add a matcher,\nyou can hook on ``_get_vcr``, for example:\n\n.. code:: python\n\n class MyTestCase(VCRTestCase):\n def _get_vcr(self, **kwargs):\n myvcr = super(MyTestCase, self)._get_vcr(**kwargs)\n myvcr.register_matcher('mymatcher', mymatcher)\n myvcr.match_on = ['mymatcher']\n return myvcr\n\nSee\n`the source\n`__\nfor the default implementations of these methods, and `VCR.py`_ for more\ninformation.\n\nVCRMixin\n~~~~~~~~\n\nIn case inheriting from ``VCRTestCase`` is difficult because of an existing\nclass hierarchy containing tests in the base classes, inherit from ``VCRMixin``\ninstead.\n\n.. code:: python\n\n from vcr_unittest import VCRMixin\n import requests\n import unittest\n\n class MyTestMixin(VCRMixin):\n def test_something(self):\n response = requests.get(self.url)\n\n class MyTestCase(MyTestMixin, unittest.TestCase):\n url = 'http://example.com'\n\nCompatibility\n-------------\n\n``VCRTestCase`` supports a subset of the Python versions supported by VCR.py.\nSpecifically Python 2.6 is excluded, because it lacks ``TestCase.addCleanup``.\nAdding support for Python 2.6 would be pretty easy with ``tearDown`` but that\nimplementation is fragile because it depends on nothing else going wrong in the\ninheritance chain. Rather than take on this additional complexity, Python 2.6 is\nsimply excluded for now.\n\nLicense\n-------\n\nThis library uses the MIT license, which is the same as VCR.py. See `LICENSE.txt\n`__ for more\ndetails.\n\nAcknowledgements\n----------------\n\nThanks to `@kevin1024`_ for `VCR.py`_, and to `@IvanMalison`_ for his\nconstructive critique on this package. Also thanks to `@nedbat`_ for his `post\nregarding unittest and context managers\n`__,\nand to `@davepeck`_ for `httreplay `__\nwhich served me well for so long.\n\n.. _PyPI: https://pypi.python.org/pypi/vcrpy-unittest\n.. _VCR.py: https://github.com/kevin1024/vcrpy\n.. _unittest: https://docs.python.org/2/library/unittest.html\n\n.. _@kevin1024: https://github.com/kevin1024\n.. _@IvanMalison: https://github.com/IvanMalison\n.. _@nedbat: https://github.com/nedbat\n.. _@davepeck: https://github.com/davepeck\n\n.. |Build Status| image:: https://img.shields.io/travis/agriffis/vcrpy-unittest/master.svg?style=plastic\n :target: https://travis-ci.org/agriffis/vcrpy-unittest?branch=master\n\n.. |Coverage Report| image:: https://img.shields.io/codecov/c/github/agriffis/vcrpy-unittest/master.svg?style=plastic\n :target: https://codecov.io/gh/agriffis/vcrpy-unittest/branch/master\n\n.. |PyPI| image:: https://img.shields.io/pypi/v/vcrpy-unittest.svg?style=plastic\n :target: PyPI_\n\n.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/vcrpy-unittest.svg?style=plastic\n :target: PyPI_\n\n.. |Gitter| image:: https://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-green.svg?style=plastic\n :target: https://gitter.im/kevin1024/vcrpy\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/agriffis/vcrpy-unittest", "keywords": "vcrpy,vcr.py,unittest,testing,mock,http", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "vcrpy-unittest", "package_url": "https://pypi.org/project/vcrpy-unittest/", "platform": "", "project_url": "https://pypi.org/project/vcrpy-unittest/", "project_urls": { "Homepage": "https://github.com/agriffis/vcrpy-unittest" }, "release_url": "https://pypi.org/project/vcrpy-unittest/0.1.7/", "requires_dist": [ "vcrpy" ], "requires_python": "", "summary": "Python unittest integration for vcr.py", "version": "0.1.7" }, "last_serial": 4308600, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "cbaa8dac4c4691599b6d372d4438f246", "sha256": "2923858c5a8c9bc3eb5524cb13039fb4b2cb5b62184f42c53c11620e8a9044e7" }, "downloads": -1, "filename": "vcrpy-unittest-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cbaa8dac4c4691599b6d372d4438f246", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3232, "upload_time": "2015-08-28T17:41:44", "url": "https://files.pythonhosted.org/packages/91/d2/92df9d7c2ba43786211108569b3c59b3702d40faea254306dabc9760f06e/vcrpy-unittest-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "42afea4dd2d2a9d9f8159905d04fcbe3", "sha256": "824e529dddbb037454752b467060667d53e8c9a75627b69f6a53b53c97a6d464" }, "downloads": -1, "filename": "vcrpy-unittest-0.1.1.tar.gz", "has_sig": false, "md5_digest": "42afea4dd2d2a9d9f8159905d04fcbe3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22945, "upload_time": "2015-08-29T00:26:51", "url": "https://files.pythonhosted.org/packages/c4/f8/f4ca08cae304481604edeb02e8cd25b294e20f7e80b4b343aa980406b4de/vcrpy-unittest-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "1238185de74df59b7652c4601060bb73", "sha256": "3559fc4bef1789b3a7f4fee9514fa415478827946a8d3723645638909d2ce4af" }, "downloads": -1, "filename": "vcrpy-unittest-0.1.2.tar.gz", "has_sig": false, "md5_digest": "1238185de74df59b7652c4601060bb73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22911, "upload_time": "2015-08-29T00:29:53", "url": "https://files.pythonhosted.org/packages/f9/08/23862eaab7d75a69de9ba81d28d18660409571104ea14b1e16faa5bb5a17/vcrpy-unittest-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "c3be9557040f31e47174338c261cbdc6", "sha256": "066abb89744b22dde5f5517d199440f9f8347c46cb2bb3a8e093b01d664abcba" }, "downloads": -1, "filename": "vcrpy-unittest-0.1.3.tar.gz", "has_sig": false, "md5_digest": "c3be9557040f31e47174338c261cbdc6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3407, "upload_time": "2015-08-29T00:32:30", "url": "https://files.pythonhosted.org/packages/35/1f/466bd70468768a6cd9569cb221bae53e7f55bd68452f48a85939a1aeb6f4/vcrpy-unittest-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "13f4322a8b34aacccd6000f988486323", "sha256": "2a81a00f6aefb96698f34a734151dd82294c544e91c6be63de926fb461e1eebb" }, "downloads": -1, "filename": "vcrpy-unittest-0.1.4.tar.gz", "has_sig": false, "md5_digest": "13f4322a8b34aacccd6000f988486323", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3495, "upload_time": "2015-12-09T14:55:27", "url": "https://files.pythonhosted.org/packages/81/f9/e8b17f2d08035343c1e9e4006978ad0413b3de29b5ef6e2f1f15594764e8/vcrpy-unittest-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "6199749bfcbdf7937cace70b926dbac5", "sha256": "71ed571bd417aaff16de8934342911ce070e9612fe44fa9594cd9f993d21dcf4" }, "downloads": -1, "filename": "vcrpy-unittest-0.1.5.tar.gz", "has_sig": false, "md5_digest": "6199749bfcbdf7937cace70b926dbac5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3762, "upload_time": "2016-04-26T22:03:32", "url": "https://files.pythonhosted.org/packages/1f/40/591cd9e6a8a69a8c1f54e7ab35201bf6cd03ab32d830bc75aa14c90b853b/vcrpy-unittest-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "5bc0129fe2fd45f707b2a5ef7b3e686a", "sha256": "bf3947115df480d280aeefe4949e59cbf0a2474916817c6a3d07e36299e8f61e" }, "downloads": -1, "filename": "vcrpy-unittest-0.1.6.tar.gz", "has_sig": false, "md5_digest": "5bc0129fe2fd45f707b2a5ef7b3e686a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3942, "upload_time": "2016-07-07T22:44:38", "url": "https://files.pythonhosted.org/packages/ba/0a/1707e22dfe8d4e2e8502c926c8edc85f9faa4ef712febb032c5328833bbe/vcrpy-unittest-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "e76bfa4568d103516ae886f6031fd446", "sha256": "b5e2d78bf4c13bc04dca04061dda934abba5f2c9d5201f148747800ff80a762b" }, "downloads": -1, "filename": "vcrpy_unittest-0.1.7-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e76bfa4568d103516ae886f6031fd446", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6790, "upload_time": "2018-09-25T14:08:34", "url": "https://files.pythonhosted.org/packages/26/1f/da7aa0b470f83fd9c7aa1c47f5ebffc63b8ef4018e2da3c0b10a3bcf7521/vcrpy_unittest-0.1.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0b64b141d2b7904c5a3c24d325ab994", "sha256": "a508d8848e678243f1c0d4b152a645c18403a8da517b8a44dfcfc35a675ec981" }, "downloads": -1, "filename": "vcrpy-unittest-0.1.7.tar.gz", "has_sig": true, "md5_digest": "d0b64b141d2b7904c5a3c24d325ab994", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3975, "upload_time": "2018-09-25T14:08:37", "url": "https://files.pythonhosted.org/packages/7c/cb/432020e833be2e9c21578a1b2c9e704662c191e02a8cafb7c0761207451d/vcrpy-unittest-0.1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e76bfa4568d103516ae886f6031fd446", "sha256": "b5e2d78bf4c13bc04dca04061dda934abba5f2c9d5201f148747800ff80a762b" }, "downloads": -1, "filename": "vcrpy_unittest-0.1.7-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "e76bfa4568d103516ae886f6031fd446", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6790, "upload_time": "2018-09-25T14:08:34", "url": "https://files.pythonhosted.org/packages/26/1f/da7aa0b470f83fd9c7aa1c47f5ebffc63b8ef4018e2da3c0b10a3bcf7521/vcrpy_unittest-0.1.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d0b64b141d2b7904c5a3c24d325ab994", "sha256": "a508d8848e678243f1c0d4b152a645c18403a8da517b8a44dfcfc35a675ec981" }, "downloads": -1, "filename": "vcrpy-unittest-0.1.7.tar.gz", "has_sig": true, "md5_digest": "d0b64b141d2b7904c5a3c24d325ab994", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3975, "upload_time": "2018-09-25T14:08:37", "url": "https://files.pythonhosted.org/packages/7c/cb/432020e833be2e9c21578a1b2c9e704662c191e02a8cafb7c0761207451d/vcrpy-unittest-0.1.7.tar.gz" } ] }