{ "info": { "author": "Vasily Kuznetsov", "author_email": "kvas.it@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Testing" ], "description": "Cli Mock\n========\n\n.. image:: https://travis-ci.org/kvas-it/pytest-console-scripts.svg?branch=master\n :target: https://travis-ci.org/kvas-it/pytest-console-scripts\n :alt: See Build Status on Travis CI\n\nThis package provides two command line utilities: ``crecord`` and ``creplay``.\nThe former records the output (stdout and stderr) and the return code of a\ncommand and the latter replays the command invocation by reproducing its output\nand return code::\n\n $ crecord echo foo\n foo\n $ creplay echo foo\n foo\n $ crecord ls foo\n ls: foo: No such file or directory\n $ creplay ls foo\n ls: foo: No such file or directory\n $ echo $?\n 1\n\nThis could be used to mock slow and environment-dependent command invocations\nfor testing purposes.\n\nPytest plugin\n-------------\n\nThere's also a pytest plugin contained in cli_mock package. It exposes\n``popen_controller`` fixture that can be used to replay ``crecord`` logs in\nresponse to ``subprocess.Popen`` invocations (and the APIs that call it under\nthe hood)::\n\n def test_foo(popen_controller):\n popen_controller.set_replay_log(my_log)\n output = subprocess.check_output(['foo'])\n assert output == b'bar\\n'\n\nAfter the replay log is activated calls to ``subprocess.Popen`` and friends\nwith the commands that are contained in the log will replay from the log.\nCommands that are not in the log will trigger an ``AssertionError``.\n\nNon-strict mode\n~~~~~~~~~~~~~~~\n\nIt's possible to allow executing commands that are not in the log via\nactivating non-strict mode::\n\n popen_controller.set_strict(False)\n\nor::\n\n popen_controller.set_replay_log(my_log, strict=False)\n\nIn non-strict mode any command that is not in the log will be passed to\n``subprocess.Popen`` without modifications and will be executed in a usual\nfashion.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/kvas-it/cli-mock", "keywords": "cli console mock record replay", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "cli-mock", "package_url": "https://pypi.org/project/cli-mock/", "platform": "", "project_url": "https://pypi.org/project/cli-mock/", "project_urls": { "Homepage": "https://github.com/kvas-it/cli-mock" }, "release_url": "https://pypi.org/project/cli-mock/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Mock command line utils by replaying recorded invocations", "version": "0.2.1" }, "last_serial": 3557393, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "bcd003d8d9e413abffa5370e2889551e", "sha256": "25862b77855b8449da6faacf5da58657188c61617df76b5ffa63c4362e81a382" }, "downloads": -1, "filename": "cli_mock-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bcd003d8d9e413abffa5370e2889551e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3591, "upload_time": "2016-11-09T11:08:12", "url": "https://files.pythonhosted.org/packages/0d/9e/cc5bcc63c5ecc52dc63f1385d06c6ffcc595cfdd4f7cf27ffca02ca897da/cli_mock-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "cea635ea1b5cbab572dec3fec0b46b21", "sha256": "f3222fef1a41579bd1ab556f9e9c6202239d6ce6924b18cc3c11e1c34dfaef4a" }, "downloads": -1, "filename": "cli_mock-0.1.0.tar.gz", "has_sig": false, "md5_digest": "cea635ea1b5cbab572dec3fec0b46b21", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4277, "upload_time": "2016-11-11T13:57:30", "url": "https://files.pythonhosted.org/packages/e6/be/c10ecd59548fb1af292283ea4f3f6512d2071a3d7ee25e06d92a87901074/cli_mock-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "98308acd726e26cb7c2d04144900929c", "sha256": "c6af884afd1b799faaf1d1dda7cf180640c44b04b4b5b5a4f6cee66a70d408c0" }, "downloads": -1, "filename": "cli_mock-0.2.0.tar.gz", "has_sig": false, "md5_digest": "98308acd726e26cb7c2d04144900929c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4634, "upload_time": "2016-11-18T17:20:03", "url": "https://files.pythonhosted.org/packages/be/a9/7c32c2b876bb1464dd6ffd10e060a02eb9879e0b992e23bf3874ffe5f78a/cli_mock-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "84f17557616a46c965b2948ca44ddef2", "sha256": "c4ba87df89d33d1dda4f0bb5b333e41145cf059a273671a904994cf43afe7dae" }, "downloads": -1, "filename": "cli_mock-0.2.1.tar.gz", "has_sig": false, "md5_digest": "84f17557616a46c965b2948ca44ddef2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4633, "upload_time": "2018-02-06T15:02:15", "url": "https://files.pythonhosted.org/packages/1f/11/9cbb545a26674adb8c69dcef10c056873b43cfdda367838f3c20fd317ad0/cli_mock-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "84f17557616a46c965b2948ca44ddef2", "sha256": "c4ba87df89d33d1dda4f0bb5b333e41145cf059a273671a904994cf43afe7dae" }, "downloads": -1, "filename": "cli_mock-0.2.1.tar.gz", "has_sig": false, "md5_digest": "84f17557616a46c965b2948ca44ddef2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4633, "upload_time": "2018-02-06T15:02:15", "url": "https://files.pythonhosted.org/packages/1f/11/9cbb545a26674adb8c69dcef10c056873b43cfdda367838f3c20fd317ad0/cli_mock-0.2.1.tar.gz" } ] }