{ "info": { "author": "Alessandro Amici", "author_email": "alexamici@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing" ], "description": ".. This document is intended as the main entry point for new users,\n it serves as the landing page on GitHub and on PyPI and\n it is also used as Quickstart section of the docs.\n Its goal are:\n * inspire and raise interest in new users\n * present one complete end-to-end use case\n * direct interested users to the appropriate project resource\n * state license and open source nature\n * credit contributors\n Anything else should go into docs.\n\n.. NOTE: only the first couple of lines of the README are shown on GitHub mobile\n\nnodev.specs helps you write robust tests that describe the abstract behaviour of your code\nleaving many implementation details out of your tests.\n\nThe general idea is best explained with an example,\nlet's write a specification test for the following function ``skip_comments`` that\nreturns the non-comment part of every line in the input file::\n\n def skip_comments(stream):\n return [line.partition('#')[0] for line in stream]\n\nThe simplest unit test may look like the following::\n\n def test_skip_comments():\n assert skip_comments(['# comment']) == ['']\n assert skip_comments(['value # comment']) == ['value ']\n assert skip_comments(['value 1', '', 'value 2']) == ['value 1', '', value 2']\n\nSuch a unit test is much more tied to current ``skip_comments`` implementation than it needs to be\nand the test will need update every time a tiny feature is added,\nlike turning the function into a generator::\n\n def skip_comments(stream):\n for line in stream:\n yield line.partition('#')[0]\n\nThis can be fixed by re-writing the test in more generic way::\n\n def test_skip_comments():\n assert '' in skip_comments(['# comment'])\n assert 'value ' in skip_comments(['value # comment'])\n assert 'value 1' in skip_comments(['value 1', '', 'value 2'])\n assert 'value 2' in skip_comments(['value 1', '', 'value 2'])\n\nLet's re-write the test making use of the ``nodev.specs.FlatContainer`` helper::\n\n def test_skip_comments():\n assert '' in FlatContainer(skip_comments(['# comment']))\n assert 'value ' in FlatContainer(skip_comments(['value # comment']))\n assert 'value 1' in FlatContainer(skip_comments(['value 1', '', 'value 2']))\n assert 'value 2' in FlatContainer(skip_comments(['value 1', '', 'value 2']))\n\nNow you can choose to skip empty lines returning the current line index instead::\n\n def skip_comments(stream):\n for index, line in enumerate(stream):\n value = line.partition('#')[0]\n if value:\n yield index, value\n\nOr return also the comment for every line::\n\n def skip_comments(stream):\n for index, line in enumerate(stream):\n value, sep, comment = line.partition('#')\n if value:\n yield index, value, sep + comment\n\nThe nodev test needs no update because it makes almost no assumption on the details\nof the return value.\n\n\nProject resources\n-----------------\n\n============= ======================\nSupport https://stackoverflow.com/search?q=nodev\nDevelopment https://github.com/nodev-io/nodev.specs\nDiscussion To be decided, see issue `#15 `_\n of the pytest-nodev repository.\nDownload https://pypi.python.org/pypi/nodev.specs\nCode quality .. image:: https://api.travis-ci.org/nodev-io/nodev.specs.svg?branch=master\n :target: https://travis-ci.org/nodev-io/nodev.specs/branches\n :alt: Build Status on Travis CI\n .. image:: https://ci.appveyor.com/api/projects/status/github/nodev-io/nodev.specs?branch=master\n :target: https://ci.appveyor.com/project/alexamici/nodev.specs/branch/master\n :alt: Build Status on AppVeyor\n .. image:: https://coveralls.io/repos/nodev-io/nodev.specs/badge.svg?branch=master&service=github\n :target: https://coveralls.io/github/nodev-io/nodev.specs?branch=master\n :alt: Coverage Status on Coveralls\nnodev website http://nodev.io\n============= ======================\n\n\nContributing\n------------\n\nContributions are very welcome. Please see the `CONTRIBUTING`_ document for\nthe best way to help.\nIf you encounter any problems, please file an issue along with a detailed description.\n\n.. _`CONTRIBUTING`: https://github.com/nodev-io/nodev.specs/blob/master/CONTRIBUTING.rst\n\nAuthors:\n\n- Alessandro Amici - `@alexamici `_\n\nSponsors:\n\n- .. image:: http://www.bopen.it/wp-content/uploads/2016/01/logo-no-back.png\n :target: http://bopen.eu/\n :alt: B-Open Solutions srl\n\n\nLicense\n-------\n\nnodev.specs is free and open source software\ndistributed under the terms of the `MIT `_ license.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/nodev-io/nodev.specs/archive/0.3.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nodev-io/nodev.specs", "keywords": "test-driven source code search nodev", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "nodev.specs", "package_url": "https://pypi.org/project/nodev.specs/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/nodev.specs/", "project_urls": { "Download": "https://github.com/nodev-io/nodev.specs/archive/0.3.1.tar.gz", "Homepage": "https://github.com/nodev-io/nodev.specs" }, "release_url": "https://pypi.org/project/nodev.specs/0.3.1/", "requires_dist": [ "future" ], "requires_python": "", "summary": "nodev helpers to write specification tests.", "version": "0.3.1" }, "last_serial": 2236714, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "05dd6cbd055787ddb0dbebf400012ab3", "sha256": "94497ae2398d7e66683146e36cb1f27893be23a28779270f9fe3314b71a4e3d7" }, "downloads": -1, "filename": "nodev.specs-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "05dd6cbd055787ddb0dbebf400012ab3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4766, "upload_time": "2016-02-17T19:45:55", "url": "https://files.pythonhosted.org/packages/91/3f/98a8994977351d4450e4ced38429778f1f75aa1cce6d972432a9b978b466/nodev.specs-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c753623e9bae1531f6450441706202b4", "sha256": "f6804e7899b310602ba967c13322538070c0ed0a3b26e577aa262458eae79d8f" }, "downloads": -1, "filename": "nodev.specs-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c753623e9bae1531f6450441706202b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3622, "upload_time": "2016-02-17T19:45:59", "url": "https://files.pythonhosted.org/packages/91/d3/46e8d33983c1958bcdf68ea1ee0c5557956dcf0303352ad83681919c5a40/nodev.specs-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "fc8b28e9353d1f1c74d5c8518c035b59", "sha256": "1592ffe25161975a14c7cc3c2ec70cedcdda9f14db0bea1ebb8a3e06a1462f40" }, "downloads": -1, "filename": "nodev.specs-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fc8b28e9353d1f1c74d5c8518c035b59", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4942, "upload_time": "2016-03-05T12:22:39", "url": "https://files.pythonhosted.org/packages/88/4b/da37d933598894aeb9b3b49e645054ea701e765222b93dc3695f18bc8f4e/nodev.specs-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9847d91aa713bb0ae278414c9ce6e2b9", "sha256": "3344b67dfda74204ea7b84a77ce388dafbac8fc51c6679b8b6fe74afd1103379" }, "downloads": -1, "filename": "nodev.specs-0.2.0.tar.gz", "has_sig": false, "md5_digest": "9847d91aa713bb0ae278414c9ce6e2b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4061, "upload_time": "2016-03-05T12:22:53", "url": "https://files.pythonhosted.org/packages/c1/01/93887d9c64e089eb0df5af1ac30fe6d7baa9c50540f3a3bebf9cb6dc6944/nodev.specs-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e33fe69e9cff389fee2650832db254d4", "sha256": "3a6bbe733fdc427f60043931ab1f72772d87df04a265151c117ddbbe2e69864d" }, "downloads": -1, "filename": "nodev.specs-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e33fe69e9cff389fee2650832db254d4", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8290, "upload_time": "2016-07-18T09:33:24", "url": "https://files.pythonhosted.org/packages/f9/74/308c33aa890ebe3e758b714fec2d550b137f35e19e53883ce03a7a17a22c/nodev.specs-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "98fc9db9507ac4672a1b235b9ed6ba5a", "sha256": "97e8e4e30096add23bf3ac6c28977981d7915789d12133854fe3ca2aef9ea366" }, "downloads": -1, "filename": "nodev.specs-0.3.0.tar.gz", "has_sig": false, "md5_digest": "98fc9db9507ac4672a1b235b9ed6ba5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6811, "upload_time": "2016-07-18T09:33:26", "url": "https://files.pythonhosted.org/packages/0a/67/aae5da30af6fb58f09fa0637ac2663f98bffbf0fab84bfd4268afe6d00bf/nodev.specs-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "0aa7ed472b882859dfab767b1ff127f2", "sha256": "588fc8dd84bf14d8b78f14228b8211d9117314484ca36905cca8821629f00919" }, "downloads": -1, "filename": "nodev.specs-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0aa7ed472b882859dfab767b1ff127f2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8283, "upload_time": "2016-07-21T22:45:03", "url": "https://files.pythonhosted.org/packages/ee/91/46c6857b7d32b8b8083215dc7da8e41ea69afe2d8f2baa358f68848e8036/nodev.specs-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f21e5e30716317321c943d9dac7adbe5", "sha256": "209506e6c73be3c0a007039f97ad4b83cb96443f4e876732e0b07c5a9cee54de" }, "downloads": -1, "filename": "nodev.specs-0.3.1.tar.gz", "has_sig": false, "md5_digest": "f21e5e30716317321c943d9dac7adbe5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6846, "upload_time": "2016-07-21T22:45:06", "url": "https://files.pythonhosted.org/packages/c0/51/4e85802fbdec9cb65f44a8f1a73a7b804b7ae957ff45ac2d2759a536ea63/nodev.specs-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0aa7ed472b882859dfab767b1ff127f2", "sha256": "588fc8dd84bf14d8b78f14228b8211d9117314484ca36905cca8821629f00919" }, "downloads": -1, "filename": "nodev.specs-0.3.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0aa7ed472b882859dfab767b1ff127f2", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8283, "upload_time": "2016-07-21T22:45:03", "url": "https://files.pythonhosted.org/packages/ee/91/46c6857b7d32b8b8083215dc7da8e41ea69afe2d8f2baa358f68848e8036/nodev.specs-0.3.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f21e5e30716317321c943d9dac7adbe5", "sha256": "209506e6c73be3c0a007039f97ad4b83cb96443f4e876732e0b07c5a9cee54de" }, "downloads": -1, "filename": "nodev.specs-0.3.1.tar.gz", "has_sig": false, "md5_digest": "f21e5e30716317321c943d9dac7adbe5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6846, "upload_time": "2016-07-21T22:45:06", "url": "https://files.pythonhosted.org/packages/c0/51/4e85802fbdec9cb65f44a8f1a73a7b804b7ae957ff45ac2d2759a536ea63/nodev.specs-0.3.1.tar.gz" } ] }