{ "info": { "author": "See AUTHORS", "author_email": "\"guillaume.jeusel@gmail.com\"", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Pytest", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 3.6" ], "description": ".. image:: https://travis-ci.com/gjeusel/pytest-vcrpandas.svg?branch=master\n :target: https://travis-ci.com/gjeusel/pytest-vcrpandas\n.. image:: https://readthedocs.org/projects/pytest-vcrpandas/badge/?version=latest\n :target: http://pytest-vcrpandas.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n.. image:: https://codecov.io/gh/gjeusel/pytest-vcrpandas/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/gjeusel/pytest-vcrpandas\n.. image:: https://badge.fury.io/py/pytest-vcrpandas.svg\n :target: https://pypi.python.org/pypi/pytest-vcrpandas/\n :alt: Pypi package\n\n===============================\npytest-vcrpandas\n===============================\n\nCombine `vcrpy `_ with\n`pandas `_ to not only mock your HTTP interactions,\nbut also tests your post-processing work to get a pandas DataFrame.\n\nUsage\n-----\n\n.. code:: python\n\n # test_meteo_client.py\n\n def test_meteo_get_wind_speed(vcrpandas, client):\n start = pd.Timestamp('2018-01-01', tz='CET')\n end = pd.Timestamp('2018-02-01', tz='CET')\n with vcrpandas(\"meteo_get_wind_speed\") as recorder:\n df = client.get_wind_speed(start, end)\n recorder(df)\n\n\n.. code:: bash\n\n # call pytest for the first time to generate samples\n > pytest --vcr-record=\"new_episodes\"\n\n # you can now replay it:\n > pytest\n\n\nBehind the hood, 2 files are generated by the first run:\n\n- a *meteo_get_wind_speed.yaml*, which is the reponse obtained by\n the first HTTP interaction.\n- a *meteo_get_wind_speed.pickle* that serve to compare the formatting from\n the mocked response to the pandas DataFrame, types included.\n\n\nInstallation\n------------\n\n.. code:: bash\n\n pip install pytest-vcrpandas\n\n\nAdvanced Usage\n--------------\n\nTo configure VCR, here is how to procee:\n\n\n.. code:: python\n\n @pytest.fixture\n def my_vcrpandas(vcrpandas):\n custom_vcr_config = dict(\n serializer='json',\n cassette_library_dir='fixtures/myclient/cassettes',\n match_on=['uri', 'method'],\n filter_headers=['authorization'], # filter information from HTTP Headers\n filter_query_parameters=['api_key'], # filter information from HTTP query string\n filter_post_data_parameters=['client_secret'], # filter information from HTTP post data\n )\n vcrpandas.config.update(custom_vcr_config)\n return vcrpandas\n\n\n def test_mysupertest(my_vcrpandas):\n with my_vcrpandas(\"random_bucket_name\") as recorder:\n recorder(CL.get_stuff())\n\n\nRefere to `VCR configuration `_ to get the\nfull list of options.\n\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/gjeusel/pytest-vcrpandas", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pytest-vcrpandas", "package_url": "https://pypi.org/project/pytest-vcrpandas/", "platform": "", "project_url": "https://pypi.org/project/pytest-vcrpandas/", "project_urls": { "Homepage": "https://github.com/gjeusel/pytest-vcrpandas" }, "release_url": "https://pypi.org/project/pytest-vcrpandas/0.0.2/", "requires_dist": [ "vcrpy", "pandas", "pytest" ], "requires_python": "", "summary": "Test from HTTP interactions to dataframe processed.", "version": "0.0.2" }, "last_serial": 4688266, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "1c708e80c176b23fcd554be18e6069db", "sha256": "e69ddd32375d34534977ec39a2c2d8e789ea9a22061469f3e3fe0830377a6269" }, "downloads": -1, "filename": "pytest_vcrpandas-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1c708e80c176b23fcd554be18e6069db", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4871, "upload_time": "2018-11-26T08:07:20", "url": "https://files.pythonhosted.org/packages/44/1e/165b4db92df50b8c51aeb676fac554268fab0f5a7cdc60f09db4c6f4d768/pytest_vcrpandas-0.0.1-py2.py3-none-any.whl" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "cab3b43cd883ffd72602e6a645767bc9", "sha256": "14882a5c79eb25c3ba1441703c2c4da27d71e2c76c2d9f5ff3adeeed7638111c" }, "downloads": -1, "filename": "pytest_vcrpandas-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cab3b43cd883ffd72602e6a645767bc9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5274, "upload_time": "2019-01-12T11:29:13", "url": "https://files.pythonhosted.org/packages/4f/c5/9db9ba5a4e55ee8ef6fa837f636f0ec61173699002ad108b76b2fc7ca718/pytest_vcrpandas-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bc226173ad814cca28bffd9a5c7f5ee4", "sha256": "eb0317b29dcdd89e88d8df5d2e4b4cb863dd869a627e019b92aae7651f926c81" }, "downloads": -1, "filename": "pytest-vcrpandas-0.0.2.tar.gz", "has_sig": false, "md5_digest": "bc226173ad814cca28bffd9a5c7f5ee4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7722, "upload_time": "2019-01-12T11:29:14", "url": "https://files.pythonhosted.org/packages/c2/46/24290ce971f04b4694ecd6b5c7d55b64d323277221bbd3a753ea9d23401a/pytest-vcrpandas-0.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cab3b43cd883ffd72602e6a645767bc9", "sha256": "14882a5c79eb25c3ba1441703c2c4da27d71e2c76c2d9f5ff3adeeed7638111c" }, "downloads": -1, "filename": "pytest_vcrpandas-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cab3b43cd883ffd72602e6a645767bc9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5274, "upload_time": "2019-01-12T11:29:13", "url": "https://files.pythonhosted.org/packages/4f/c5/9db9ba5a4e55ee8ef6fa837f636f0ec61173699002ad108b76b2fc7ca718/pytest_vcrpandas-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bc226173ad814cca28bffd9a5c7f5ee4", "sha256": "eb0317b29dcdd89e88d8df5d2e4b4cb863dd869a627e019b92aae7651f926c81" }, "downloads": -1, "filename": "pytest-vcrpandas-0.0.2.tar.gz", "has_sig": false, "md5_digest": "bc226173ad814cca28bffd9a5c7f5ee4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7722, "upload_time": "2019-01-12T11:29:14", "url": "https://files.pythonhosted.org/packages/c2/46/24290ce971f04b4694ecd6b5c7d55b64d323277221bbd3a753ea9d23401a/pytest-vcrpandas-0.0.2.tar.gz" } ] }