{ "info": { "author": "willemt", "author_email": "himself@willemthiart.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: System :: Logging" ], "description": ".. image:: https://img.shields.io/badge/rsttst-testable-brightgreen.svg\n :target: https://github.com/willemt/rsttst\n\n.. image:: https://travis-ci.org/willemt/rsttst.png\n :target: https://travis-ci.org/willemt/rsttst\n\n.. image:: https://pypip.in/version/rsttst/badge.svg\n :target: https://pypi.python.org/pypi/rsttst\n \n.. image:: https://pypip.in/download/rsttst/badge.svg\n :target: https://pypi.python.org/pypi/rsttst\n\nrsttst makes your reStructuredText documentation testable.\n\nIn fact, this README file is testable and is used to test rsttst.\n\nIf your tests document how your system works, why not formally combine your tests and documentation into one?\n\nBelow is an example:\n\n2 + 2 = 4\n=========\n\nThe title \"2 + 2 = 4\" becomes the test name after being converted to a\nPython friendly identifier (ie. 2_plus_2_equals_4).\n\nThe bash code in the below code block will be run...\n\n.. code-block:: bash\n\n echo '2 + 2' | bc\n\n...and the resulting stdout will be compared to the following code block:\n\n.. code-block:: bash\n\n 4\n\nThe test fails if stdout doesn't match the block above.\n\nDotted notation\n===============\n\nSometimes you want to be flexible with the output you accept.\n\nYou can use \".\" and the \":class: dotted\" rst directive option to support this.\n\n.. code-block:: bash\n\n echo Date: $(date)\n echo '\\ok'\n\nThe below code block uses the \":class: dotted\" option.\n\n.. code-block:: bash\n :class: dotted\n\n Date: ............................\n \\ok\n\nThree dots match in a similiar way to what you'd expect for a regex pattern of \".+\" to work:\n\n.. code-block:: bash\n\n echo ''\n echo $(date \"+DATE: %Y-%m-%d%nTIME: %H:%M:%S\")\n\nThe below code block uses the \":class: dotted\" option.\n\n.. code-block:: bash\n :class: dotted\n\n <...>\n DATE: ... TIME: ...\n\nGenerating tests\n================\n\nUnder the hood rsttst generates Python code which is executable with py.test.\nHere's how we generate the Python test code:\n\n.. code-block:: bash\n\n rsttst README.rst\n cat test_readme.py | head -n 28\n\nThe resulting test code looks like the following:\n\n.. code-block:: bash\n\n # -*- coding: utf-8 -*-\n from rsttst.core import run, Dotted\n \n def test_2_plus_2_equals_4():\n output = run(u\"\"\"echo '2 + 2' | bc\"\"\")\n assert output == u\"\"\"4\"\"\"\n \n def test_dotted_notation():\n output = run(u\"\"\"echo Date: $(date)\n echo '\\\\ok'\"\"\")\n expected = Dotted(u\"\"\"Date: ............................\n \\\\ok\"\"\")\n cmp(output, expected)\n expected = u\"{0}\".format(expected)\n assert output == expected\n \n def test_dotted_notation__2():\n output = run(u\"\"\"echo ''\n echo $(date \"+DATE: %Y-%m-%d%nTIME: %H:%M:%S\")\"\"\")\n expected = Dotted(u\"\"\"<...>\n DATE: ... TIME: ...\"\"\")\n cmp(output, expected)\n expected = u\"{0}\".format(expected)\n assert output == expected\n \n def test_generating_tests():\n output = run(u\"\"\"rsttst README.rst\n cat test_readme.py | head -n 28\"\"\")\n\nWindows new lines\n=================\n\n^M characters are automatically removed.\n\n.. code-block:: bash\n\n printf 'supports\\012\\015windows new lines'\n\n.. code-block:: bash\n\n supports\n windows new lines\n\nIgnore code-blocks\n==================\n\nSometimes you want to use a code-block without it being tested by rsttst.\n\nYou can use the \":class: ignore\" directive to ignore this code-block:\n\n.. code-block:: bash\n :class: ignore\n\n .. code-block:: bash\n :class: ignore\n\nRunning the tests\n=================\n\nYou could probably use another test runner, but pytest works quite well:\n\n.. code-block:: bash\n\n py.test -k 'not test_running_the_tests' | grep -v seconds\n\nNote: we had to exclude 'test_running_the_tests', otherwise it's turtles all the way down.\n\n.. code-block:: bash\n :class: dotted\n\n ============================= test session starts ==============================\n platform ...\n collected 6 items\n \n test_readme.py .....\n \n ============= 1 tests deselected by '-knot test_running_the_tests' =============\n\n\nFunctionality\n=============\n\nRight now rsttst only supports bash testing.\n\nFAQ\n===\n\n*Why does pytest throw an \"IndexError: list index out of range\" exception for my JSON tests?*\n\nPlease upgrade to the latest version of pytest", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/willemt/rsttst", "keywords": "development logging", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "rsttst", "package_url": "https://pypi.org/project/rsttst/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/rsttst/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/willemt/rsttst" }, "release_url": "https://pypi.org/project/rsttst/0.3.0/", "requires_dist": null, "requires_python": null, "summary": "rsttst makes your reStructuredText testable", "version": "0.3.0" }, "last_serial": 1734243, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "bea75cd60193f3d0f3fc910fcffca85c", "sha256": "b468cc166370fa9b0347057a58655bfb80fd5bf296951cb2cefe82ce85529f81" }, "downloads": -1, "filename": "rsttst-0.1.0.tar.gz", "has_sig": false, "md5_digest": "bea75cd60193f3d0f3fc910fcffca85c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5458, "upload_time": "2014-09-23T04:47:01", "url": "https://files.pythonhosted.org/packages/5f/a3/e2bb94d32f6b80d6be5231606377493937c0b60b68db8ce14654c435b90a/rsttst-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "af2028d686d8367b1c695b6d59fc4f56", "sha256": "15d4b052ae087c51099825b736cdff9239f2af8981c334f7d84b124ea1dddbad" }, "downloads": -1, "filename": "rsttst-0.1.1.tar.gz", "has_sig": false, "md5_digest": "af2028d686d8367b1c695b6d59fc4f56", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5570, "upload_time": "2014-09-23T06:00:31", "url": "https://files.pythonhosted.org/packages/cf/24/3352008585c0499e30547208ca9e74b53bc4dbd753d60c439fe0ae250e99/rsttst-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c97d9d5d10f722eef19713f5e600d115", "sha256": "adbd3d064e77272dfbb21a929c0f64f6bd027d5efe3f452d8ef69ca7301848ce" }, "downloads": -1, "filename": "rsttst-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c97d9d5d10f722eef19713f5e600d115", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6182, "upload_time": "2014-09-24T15:10:53", "url": "https://files.pythonhosted.org/packages/5a/7f/00e4a6f54f5159180cffac0e9a668139ba8dabb875a7cc3fb2428752e686/rsttst-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "5da6eb626d7a02385d7ba29d87235cbf", "sha256": "494429fc07a5548fa80cf2683d6ae3e9455803e51594207728e2860310fe0fd0" }, "downloads": -1, "filename": "rsttst-0.1.3.tar.gz", "has_sig": false, "md5_digest": "5da6eb626d7a02385d7ba29d87235cbf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6605, "upload_time": "2014-09-28T02:45:03", "url": "https://files.pythonhosted.org/packages/ed/f7/f2436ea4b56cc413f5f9f3fdc695737af71d4fb0ed2ec5dafbe6664c09db/rsttst-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "1dd76aef63dddac0c7cf08fc4538e0fc", "sha256": "0051cb05b8b1b41687e71d889e28c5dcb0d0918c516fe480a73bd6ac044738ce" }, "downloads": -1, "filename": "rsttst-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1dd76aef63dddac0c7cf08fc4538e0fc", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10625, "upload_time": "2015-01-28T12:02:13", "url": "https://files.pythonhosted.org/packages/91/92/e44c102b2ba31b1cc7de0f7338cee2d55ed8368a2393d6fd12014a116be6/rsttst-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a5cfa5b85aa8933c7c41082ae635337d", "sha256": "fee5c0a39c37e3944d106bdf1d109fbc8668a26cfe70cb98aafc66f151f2cd22" }, "downloads": -1, "filename": "rsttst-0.1.4.tar.gz", "has_sig": false, "md5_digest": "a5cfa5b85aa8933c7c41082ae635337d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6623, "upload_time": "2015-01-28T12:02:09", "url": "https://files.pythonhosted.org/packages/5e/ee/87b020e7aa2b4445e1499275d9239e891922c14a1a2d6624b202ab73ce68/rsttst-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "53ab666e49ad6ff7a7b9c6f621c2b35b", "sha256": "94c540c1e2a6159a443c055f8935c26dedb17813a6bf785baf1c2c9222e28de1" }, "downloads": -1, "filename": "rsttst-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "53ab666e49ad6ff7a7b9c6f621c2b35b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10676, "upload_time": "2015-02-16T00:39:55", "url": "https://files.pythonhosted.org/packages/3f/dc/faff4ad6493194de33ae93e93dbc159d3e4fe6b9acc8f823034b459759dc/rsttst-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "03b450c172203f39475f4ebeb5cdba70", "sha256": "812d6b12b60e339443ba1950070539173c5187ff12a05d40d08ee4d3d99bf9fe" }, "downloads": -1, "filename": "rsttst-0.1.5.tar.gz", "has_sig": false, "md5_digest": "03b450c172203f39475f4ebeb5cdba70", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6718, "upload_time": "2015-02-16T00:39:52", "url": "https://files.pythonhosted.org/packages/49/cd/c34df487fe78d49c81bf90502a40eedb3292f709a841a6188271887c87fa/rsttst-0.1.5.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a7cbda5189692b2841f1bae5a4893896", "sha256": "93ad6630d296400fc841018eeb9ed0776241a24a9ebecea6ce5f224690e1984b" }, "downloads": -1, "filename": "rsttst-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a7cbda5189692b2841f1bae5a4893896", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10839, "upload_time": "2015-03-07T03:09:42", "url": "https://files.pythonhosted.org/packages/ef/18/dd725521f81dbc49044089fbecfcd2930ce6a780b4d467b65d750ce62c2b/rsttst-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "07e657da7e55c1db3374b059ccaca4e4", "sha256": "387705c950c4e9cfa074b1564591e4f3721d9f1b642e40955dbb9d8a19049d75" }, "downloads": -1, "filename": "rsttst-0.2.0.tar.gz", "has_sig": false, "md5_digest": "07e657da7e55c1db3374b059ccaca4e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7440, "upload_time": "2015-03-07T03:09:39", "url": "https://files.pythonhosted.org/packages/d8/1a/ddd946e153a1b3e5c914179add4e2b8f582e92ce9441e5cfc664e3df4b5f/rsttst-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "5a287afa382a67d104eb4f625d97aa8d", "sha256": "8145635c78658dc48fce83c48b56b53a4c2c8a07eb98fcab4c910e5f68347dcf" }, "downloads": -1, "filename": "rsttst-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5a287afa382a67d104eb4f625d97aa8d", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11034, "upload_time": "2015-05-15T13:39:44", "url": "https://files.pythonhosted.org/packages/f0/21/2ae732642488f9e883d18f3e408311aecb870da9ca241761c5287c567c51/rsttst-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d1603f1ae58ceabc057a7b3fd1cba655", "sha256": "cb898c4b099845a28ec803d8a722e4c2f756aea2e61dcb792edc89068e38ea6f" }, "downloads": -1, "filename": "rsttst-0.2.1.tar.gz", "has_sig": false, "md5_digest": "d1603f1ae58ceabc057a7b3fd1cba655", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7576, "upload_time": "2015-05-15T13:39:34", "url": "https://files.pythonhosted.org/packages/b6/25/a0f245cbef194d9b5f0ed2fdb1b8ed2f4be2ff3a58dbaea00d3db06080e9/rsttst-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "27a7cb0b056c8fadf088fa3509204cc6", "sha256": "2f09053580d2a8362646c81830bd9066f81b19ae23ae8c3b62fc3ffab84e61ee" }, "downloads": -1, "filename": "rsttst-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "27a7cb0b056c8fadf088fa3509204cc6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11093, "upload_time": "2015-09-23T03:14:34", "url": "https://files.pythonhosted.org/packages/a9/e3/b24da4071897d9bf9a3fec1cdfba0da2b0d85d8c66b932c542d71b97890e/rsttst-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "825af886e036353813975e6a694e53c4", "sha256": "d4acb2a4999bf9ed0b6f32dab3c24c2b8ac9750a9632d9eef477fbfb5bb1f94a" }, "downloads": -1, "filename": "rsttst-0.3.0.tar.gz", "has_sig": false, "md5_digest": "825af886e036353813975e6a694e53c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7628, "upload_time": "2015-09-23T03:14:30", "url": "https://files.pythonhosted.org/packages/b5/d9/fed43b27554822d8dd227f290707ae06eabf223a79522a27a1e1469994f3/rsttst-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "27a7cb0b056c8fadf088fa3509204cc6", "sha256": "2f09053580d2a8362646c81830bd9066f81b19ae23ae8c3b62fc3ffab84e61ee" }, "downloads": -1, "filename": "rsttst-0.3.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "27a7cb0b056c8fadf088fa3509204cc6", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 11093, "upload_time": "2015-09-23T03:14:34", "url": "https://files.pythonhosted.org/packages/a9/e3/b24da4071897d9bf9a3fec1cdfba0da2b0d85d8c66b932c542d71b97890e/rsttst-0.3.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "825af886e036353813975e6a694e53c4", "sha256": "d4acb2a4999bf9ed0b6f32dab3c24c2b8ac9750a9632d9eef477fbfb5bb1f94a" }, "downloads": -1, "filename": "rsttst-0.3.0.tar.gz", "has_sig": false, "md5_digest": "825af886e036353813975e6a694e53c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7628, "upload_time": "2015-09-23T03:14:30", "url": "https://files.pythonhosted.org/packages/b5/d9/fed43b27554822d8dd227f290707ae06eabf223a79522a27a1e1469994f3/rsttst-0.3.0.tar.gz" } ] }