{ "info": { "author": "Syrus Akbary", "author_email": "me@syrusakbary.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Pytest", "Intended Audience :: Developers", "Operating System :: OS Independent", "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", "Topic :: Software Development :: Libraries" ], "description": "SnapshotTest |travis| |pypi|\n============================\n\nSnapshot testing is a way to test your APIs without writing actual test\ncases.\n\n1. A snapshot is a single state of your API, saved in a file.\n2. You have a set of snapshots for your API endpoints.\n3. Once you add a new feature, you can generate *automatically* new\n snapshots for the updated API.\n\nInstallation\n------------\n\n::\n\n $ pip install snapshottest\n\nUsage with unittest/nose\n------------------------\n\n.. code:: python\n\n from snapshottest import TestCase\n\n class APITestCase(TestCase):\n def test_api_me(self):\n \"\"\"Testing the API for /me\"\"\"\n my_api_response = api.client.get('/me')\n self.assertMatchSnapshot(my_api_response)\n\n # Set custom snapshot name: `gpg_response`\n my_gpg_response = api.client.get('/me?gpg_key')\n self.assertMatchSnapshot(my_gpg_response, 'gpg_response')\n\nIf you want to update the snapshots automatically you can use the\n``nosetests --snapshot-update``.\n\nCheck the `Unittest\nexample `__.\n\nUsage with pytest\n-----------------\n\n.. code:: python\n\n def test_mything(snapshot):\n \"\"\"Testing the API for /me\"\"\"\n my_api_response = api.client.get('/me')\n snapshot.assert_match(my_api_response)\n\n # Set custom snapshot name: `gpg_response`\n my_gpg_response = api.client.get('/me?gpg_key')\n snapshot.assert_match(my_gpg_response, 'gpg_response')\n\nIf you want to update the snapshots automatically you can use the\n``--snapshot-update`` config.\n\nCheck the `Pytest\nexample `__.\n\nUsage with django\n-----------------\n\nAdd to your settings:\n\n.. code:: python\n\n TEST_RUNNER = 'snapshottest.django.TestRunner'\n\nTo create your snapshottest:\n\n.. code:: python\n\n from snapshottest.django import TestCase\n\n class APITestCase(TestCase):\n def test_api_me(self):\n \"\"\"Testing the API for /me\"\"\"\n my_api_response = api.client.get('/me')\n self.assertMatchSnapshot(my_api_response)\n\nIf you want to update the snapshots automatically you can use the\n``python manage.py test --snapshot-update``. Check the `Django\nexample `__.\n\nContributing\n============\n\nAfter cloning this repo and configuring a virtualenv for snapshottest\n(optional, but highly recommended), ensure dependencies are installed by\nrunning:\n\n.. code:: sh\n\n make install\n\nAfter developing, the full test suite can be evaluated by running:\n\n.. code:: sh\n\n make lint\n # and\n make test\n\nIf you change this ``README.md``, you'll need to have pandoc installed to update its ``README.rst`` counterpart (used by PyPI),\nwhich can be done by running:\n\n::\n\n make README.rst\n\nNotes\n=====\n\nThis package is heavily inspired in `jest snapshot\ntesting `__.\n\nReasons for use this package\n============================\n\n Most of this content is taken from the `Jest snapshot\n blogpost `__.\n\nWe want to make it as frictionless as possible to write good tests that\nare useful. We observed that when engineers are provided with\nready-to-use tools, they end up writing more tests, which in turn\nresults in stable and healthy code bases.\n\nHowever engineers frequently spend more time writing a test than the\ncomponent itself. As a result many people stopped writing tests\naltogether which eventually led to instabilities.\n\nA typical snapshot test case for a mobile app renders a UI component,\ntakes a screenshot, then compares it to a reference image stored\nalongside the test. The test will fail if the two images do not match:\neither the change is unexpected, or the screenshot needs to be updated\nto the new version of the UI component.\n\nSnapshot Testing with SnapshotTest\n----------------------------------\n\nA similar approach can be taken when it comes to testing your APIs.\nInstead of rendering the graphical UI, which would require building the\nentire app, you can use a test renderer to quickly generate a\nserializable value for your API response.\n\nLicense\n-------\n\n`MIT\nLicense `__\n\n|coveralls|\n\n.. |travis| image:: https://img.shields.io/travis/syrusakbary/snapshottest.svg?style=flat\n :target: https://travis-ci.org/syrusakbary/snapshottest\n.. |pypi| image:: https://img.shields.io/pypi/v/snapshottest.svg?style=flat\n :target: https://pypi.python.org/pypi/snapshottest\n.. |coveralls| image:: https://coveralls.io/repos/syrusakbary/snapshottest/badge.svg?branch=master&service=github\n :target: https://coveralls.io/github/syrusakbary/snapshottest?branch=master\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/syrusakbary/snapshottest", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "snapshottest", "package_url": "https://pypi.org/project/snapshottest/", "platform": "", "project_url": "https://pypi.org/project/snapshottest/", "project_urls": { "Homepage": "https://github.com/syrusakbary/snapshottest" }, "release_url": "https://pypi.org/project/snapshottest/0.5.1/", "requires_dist": null, "requires_python": "", "summary": "Snapshot Testing utils for Python", "version": "0.5.1" }, "last_serial": 5528795, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "17c92bfcda3dff06da620f0b67502eae", "sha256": "5ff2d22b6d4be41c0b5d3b8bdb7fd800d35fd4bcba2180e12ed47b7f600217e3" }, "downloads": -1, "filename": "snapshottest-0.1.0.tar.gz", "has_sig": false, "md5_digest": "17c92bfcda3dff06da620f0b67502eae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7358, "upload_time": "2017-04-10T03:39:37", "url": "https://files.pythonhosted.org/packages/c6/c5/a7f8146738961868c29dfb7151d57ff22deadbbe2c290131ab6206d2895c/snapshottest-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f9535d5722da87c34162ef135a0ff95c", "sha256": "a46cb351915d2babe5d7359b07b8a3a4dd9748a8f237c14eae797b8b54619fba" }, "downloads": -1, "filename": "snapshottest-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f9535d5722da87c34162ef135a0ff95c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9918, "upload_time": "2017-04-10T10:53:20", "url": "https://files.pythonhosted.org/packages/6d/c3/f0aeccd281f42e293dcec7424911664bc5e343e66b35e7e03307698495d4/snapshottest-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "98b43d0dd90c4b8c8bcadcd385ba6a62", "sha256": "b92cf1939d8558bbe9986bf51a25eb48ef5bd66c6a2c5945d09e0e978b73e303" }, "downloads": -1, "filename": "snapshottest-0.2.1.tar.gz", "has_sig": false, "md5_digest": "98b43d0dd90c4b8c8bcadcd385ba6a62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10031, "upload_time": "2017-04-10T11:25:21", "url": "https://files.pythonhosted.org/packages/d0/76/4d08171ca038251f9df3c49689aa744564f9780ac5831edccc8b4f43a2d8/snapshottest-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "5e9a5f3bb90fc04b33d788c4661811c9", "sha256": "a0d72c0372a4ab10df9b673886d12661dcf3217615c09ad53133b27f3073ff30" }, "downloads": -1, "filename": "snapshottest-0.2.2.tar.gz", "has_sig": false, "md5_digest": "5e9a5f3bb90fc04b33d788c4661811c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10050, "upload_time": "2017-04-10T11:46:19", "url": "https://files.pythonhosted.org/packages/ab/a6/b864cecb837f41962120e39df804195538b0e04eb39ee809624dad0396f1/snapshottest-0.2.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "77fff7bb4449b230bf9b1a556832a12a", "sha256": "22094c7dcf17fe6d32a90f7edbe15067ecc83e5c452dc827dcf2bc57faa99eb8" }, "downloads": -1, "filename": "snapshottest-0.3.0.tar.gz", "has_sig": false, "md5_digest": "77fff7bb4449b230bf9b1a556832a12a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10100, "upload_time": "2017-04-10T12:08:42", "url": "https://files.pythonhosted.org/packages/93/26/4068277f2939a5356564c3bfb809bed8ed4d5838b891fd9383023dd91628/snapshottest-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "109667975601b64aefc11f64ce3e7566", "sha256": "319262e8c112ef445ccdbd79c2942696faaeb3f3da9aa988586589d1fedad219" }, "downloads": -1, "filename": "snapshottest-0.4.0.tar.gz", "has_sig": false, "md5_digest": "109667975601b64aefc11f64ce3e7566", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10836, "upload_time": "2017-04-11T06:50:02", "url": "https://files.pythonhosted.org/packages/65/86/1b4fd67dd4a99e78049f0b7ece00c4bb365352c3eddec61cd6ae3b2977cc/snapshottest-0.4.0.tar.gz" } ], "0.5.0": [ { "comment_text": "", "digests": { "md5": "fb9f4d3e42016de109973c52fecd88c5", "sha256": "215c28eb397fd171a25a0e7d8b7b82d39619bf38d0e44de97c38842e8495b40c" }, "downloads": -1, "filename": "snapshottest-0.5.0.tar.gz", "has_sig": false, "md5_digest": "fb9f4d3e42016de109973c52fecd88c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11662, "upload_time": "2017-06-30T07:31:14", "url": "https://files.pythonhosted.org/packages/38/9d/6114ac51327ee8be784ebde5fb21606e161097a41eac3e0619bfc7fad0fd/snapshottest-0.5.0.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "ef976d82b94c5d287b8d23c797e9ebd6", "sha256": "2cc7157e77674ea8ebeb2351466ff50cd4b5ad8e213adc06df9c16a75ab5bafc" }, "downloads": -1, "filename": "snapshottest-0.5.1.tar.gz", "has_sig": false, "md5_digest": "ef976d82b94c5d287b8d23c797e9ebd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13976, "upload_time": "2019-07-14T03:27:04", "url": "https://files.pythonhosted.org/packages/e0/dd/418e21530ef49b334211235e95a7212694a636687a4e2bc4be226cc84e40/snapshottest-0.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ef976d82b94c5d287b8d23c797e9ebd6", "sha256": "2cc7157e77674ea8ebeb2351466ff50cd4b5ad8e213adc06df9c16a75ab5bafc" }, "downloads": -1, "filename": "snapshottest-0.5.1.tar.gz", "has_sig": false, "md5_digest": "ef976d82b94c5d287b8d23c797e9ebd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13976, "upload_time": "2019-07-14T03:27:04", "url": "https://files.pythonhosted.org/packages/e0/dd/418e21530ef49b334211235e95a7212694a636687a4e2bc4be226cc84e40/snapshottest-0.5.1.tar.gz" } ] }