{ "info": { "author": "Ivan Krukov", "author_email": "ivan.o.kryukov@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: Unix", "Programming Language :: Python" ], "description": "[![Build Status](https://travis-ci.org/ivan-krukov/doctest-cli.svg?branch=master)](https://travis-ci.org/ivan-krukov/doctest-cli)\n\n# doctest-cli\n\nDoctests for your shell.\nRun an executable, check the output.\n\n## Installation\n\nWith `pip`:\n\n```bash\npip install doctest-cli\n```\n\nBy hand:\n```bash\ncurl -O https://github.com/ivan-krukov/doctest-cli/blob/master/bin/doctest-cli ~/bin\nchmod +x ~/bin/doctest-cli\n```\n\n## Usage\n\nCreate a test script, say `test.sh`:\n\n```sh\n# Command\n>>> echo hello\n# Expected output\nhello\n\n# Another command\n>>> echo 'Good bye!'\nGood bye!\n\n# Failing\n>>> echo banana\napple\n```\n\nTest it:\n\n```bash\ndoctest-cli test.sh\n```\n\nCheck output:\n```\ndoctest-cli: test/simple.sh\n------------------------------------------------------------\nError while running:\n echo banana\nWith STDERR:\n\nExpected STDOUT:\n apple\nGot:\n banana\n------------------------------------------------------------\nTests ran: 3\nTests passed: 2\nTests failed: 1\n```\n\n## Dependencies\n\nThe program depends on `python` - both `2.7` and `3.4` and above should work\n\n## Extra \n\nSee `test/` for more examples.\n\n### Return code\n\nCheck return code by adding `$?=` to the beginning of the line. Default return code is `0`:\n\n```sh\n>>> false\n$?=1\n>>> true\n$?=0\n```\n\n### Standard error\n\nCheck `stderr` output by adding `!` to the beginning of the line:\n\n```sh\n>>> echo error > /dev/stderr\n! error\n```\n\nBy default, the `stderr` stream is assumed to be empty.\n\n### Custom shell\n\nYou can use a custom shell with a shebang line:\n\n```fish\n#!/usr/local/bin/fish\n>>> echo hello; and echo this is fish\nhello\nthis is fish\n```\n\n## Details\n\n`doctest-cli` uses `python`'s `subprocess` module to spawn a new shell for each command and checks the output against the lines provided. All the environment variables are inherited from the parent session. \n\nWhitespace (including intervening newlines) is ignored. For example, the following test should pass, since all the newlines in the middle are removed:\n\n```sh\n>>>printf 'hello\\n\\n\\n\\n\\n\\nworld'\nhello\nworld\n```\n\nThis is done so that you can have an arbitrary amount of whitespace delineating the test blocks.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ivan-krukov/doctest-cli", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "doctest-cli", "package_url": "https://pypi.org/project/doctest-cli/", "platform": "", "project_url": "https://pypi.org/project/doctest-cli/", "project_urls": { "Homepage": "https://github.com/ivan-krukov/doctest-cli" }, "release_url": "https://pypi.org/project/doctest-cli/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "Doctests for your shell", "version": "0.0.3" }, "last_serial": 4252069, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "09732b97807b131ffe254c3a24337d99", "sha256": "c9dbfe312f668ef5ec675231d0d647f661456b432089cf9fa85725b223857e71" }, "downloads": -1, "filename": "doctest_cli-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "09732b97807b131ffe254c3a24337d99", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3358, "upload_time": "2018-09-07T22:58:49", "url": "https://files.pythonhosted.org/packages/11/27/0b822afd376c03a31dacda6ab00d22c8fe4704020b61a003ef5291f75599/doctest_cli-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cf3e5c4abf69050391e141df549d5a66", "sha256": "dcf73dcdc48ddb26aa28f19d8c046f4bb7e325c0e343f92a77e23cd0b248434f" }, "downloads": -1, "filename": "doctest-cli-0.0.1.tar.gz", "has_sig": false, "md5_digest": "cf3e5c4abf69050391e141df549d5a66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2974, "upload_time": "2018-09-07T22:58:50", "url": "https://files.pythonhosted.org/packages/12/6e/7b1fedb4afe903de97f50a1cca0048b53aa70eb1b2a399d0df5c5238f9e3/doctest-cli-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "2629e54c4bbc91cecffb1f72ab80c223", "sha256": "18e21fccdd48697aa666053d2f50f7b8629b6fd0d19fd8d8516db6b7c38e1eda" }, "downloads": -1, "filename": "doctest_cli-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "2629e54c4bbc91cecffb1f72ab80c223", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3754, "upload_time": "2018-09-07T23:17:59", "url": "https://files.pythonhosted.org/packages/4f/62/0959d817a3229ae9c1747a9c44e1bc8ef8424f19b20070916c768c376efe/doctest_cli-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "798e053bc58859817df8599a9c41d458", "sha256": "624ac4a875fb168091befc6d61e6544da6f88f8ef7cd39be4efcc9966f69dc7e" }, "downloads": -1, "filename": "doctest-cli-0.0.2.tar.gz", "has_sig": false, "md5_digest": "798e053bc58859817df8599a9c41d458", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3477, "upload_time": "2018-09-07T23:18:00", "url": "https://files.pythonhosted.org/packages/47/b2/4c0ddb1b6042abe5d76fcf0cb1caa29e247bd2b45e9c676c6dfd41b8a8fc/doctest-cli-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "7dfebb218d789fa3132791f3633ffdeb", "sha256": "bdd5e23107d3e8c35dbf6a9dcf1e6260ecb9ad0a40c316037a4f4326e2329f3f" }, "downloads": -1, "filename": "doctest_cli-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "7dfebb218d789fa3132791f3633ffdeb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3767, "upload_time": "2018-09-08T19:22:12", "url": "https://files.pythonhosted.org/packages/3d/84/38acb645d0dcb89aca51d267c0651da8aee6b643d3b4ba15aa545ff24845/doctest_cli-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7d8f292c8bf05abd9ac390c10e5f8d2c", "sha256": "44c8ae83e477bb6c056bde37df3aa30f84af91459554fb0ee4a7eb523f78b9b4" }, "downloads": -1, "filename": "doctest-cli-0.0.3.tar.gz", "has_sig": false, "md5_digest": "7d8f292c8bf05abd9ac390c10e5f8d2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3489, "upload_time": "2018-09-08T19:22:14", "url": "https://files.pythonhosted.org/packages/17/42/0a1eb83ad45efc680c0202edef5d0af0b5a96dbd9c199f2e2d447d50e420/doctest-cli-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7dfebb218d789fa3132791f3633ffdeb", "sha256": "bdd5e23107d3e8c35dbf6a9dcf1e6260ecb9ad0a40c316037a4f4326e2329f3f" }, "downloads": -1, "filename": "doctest_cli-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "7dfebb218d789fa3132791f3633ffdeb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3767, "upload_time": "2018-09-08T19:22:12", "url": "https://files.pythonhosted.org/packages/3d/84/38acb645d0dcb89aca51d267c0651da8aee6b643d3b4ba15aa545ff24845/doctest_cli-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7d8f292c8bf05abd9ac390c10e5f8d2c", "sha256": "44c8ae83e477bb6c056bde37df3aa30f84af91459554fb0ee4a7eb523f78b9b4" }, "downloads": -1, "filename": "doctest-cli-0.0.3.tar.gz", "has_sig": false, "md5_digest": "7d8f292c8bf05abd9ac390c10e5f8d2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3489, "upload_time": "2018-09-08T19:22:14", "url": "https://files.pythonhosted.org/packages/17/42/0a1eb83ad45efc680c0202edef5d0af0b5a96dbd9c199f2e2d447d50e420/doctest-cli-0.0.3.tar.gz" } ] }