{ "info": { "author": "Gary Kramlich", "author_email": "grim@reaperworld.com", "bugtrack_url": null, "classifiers": [], "description": "MockProcess is a mock for the subprocess module to be used in your unit tests.\nRight now it only supports the check_output method, but eventually popen will\nbe supported as well.\n\nIt is used via a context manager. Here's a basic example\n\n>>> import subprocess\n>>> import unittest\n>>> from mockprocess import MockCheckOutput\n>>> class Test(unittest.TestCase):\n... def test_simple(self):\n... with MockCheckOutput('hello\\n'):\n... output = subprocess.check_output(['/bin/echo', 'hello'])\n... self.assertEqual(output, 'hello\\n')\n...\n\nIf you need to test how you handle errors, you can set an exit code as well.\n\n>>> import subprocess\n>>> import unittest\n>>> from mockprocess import MockCheckoutput\n>>> class Test(unittest.TestCase):\n... def test_exception(self):\n... try:\n... with MockCheckOutput('hello\\n', exit_code=127):\n... subprocess.check_output(['/bin/false'])\n... except subprocess.CalledProcessError as exp:\n... pass\n... else:\n... self.fail('exception was not raised')\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/rw_grim/mockprocess", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "mockprocess", "package_url": "https://pypi.org/project/mockprocess/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/mockprocess/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/rw_grim/mockprocess" }, "release_url": "https://pypi.org/project/mockprocess/0.2/", "requires_dist": null, "requires_python": null, "summary": "Mocks for subprocess commands", "version": "0.2" }, "last_serial": 1606641, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "fc7bbe44f5b60392fcbcf8936aa0896a", "sha256": "c43d1d19411efac0a829df1003b849df1c2b85946f830854148d6a4c626dbba3" }, "downloads": -1, "filename": "mockprocess-0.1.tar.gz", "has_sig": false, "md5_digest": "fc7bbe44f5b60392fcbcf8936aa0896a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2177, "upload_time": "2014-11-10T19:27:31", "url": "https://files.pythonhosted.org/packages/92/0b/200b23cf2cd8e9df336383ccbce6a3904fcb571dc87cda720d1f60697f26/mockprocess-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "15fd0ac9be06e5fefad3574a71b51c3c", "sha256": "305ac8a0f36713af528368676bd1c015d9f49a8853a73dc531b68ef63726aa40" }, "downloads": -1, "filename": "mockprocess-0.2.tar.gz", "has_sig": false, "md5_digest": "15fd0ac9be06e5fefad3574a71b51c3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2242, "upload_time": "2015-06-25T16:30:04", "url": "https://files.pythonhosted.org/packages/61/a6/f824b0b8f00273a939b65b08b7c419c89c07b77e2247d196d1d14fb59c10/mockprocess-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "15fd0ac9be06e5fefad3574a71b51c3c", "sha256": "305ac8a0f36713af528368676bd1c015d9f49a8853a73dc531b68ef63726aa40" }, "downloads": -1, "filename": "mockprocess-0.2.tar.gz", "has_sig": false, "md5_digest": "15fd0ac9be06e5fefad3574a71b51c3c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2242, "upload_time": "2015-06-25T16:30:04", "url": "https://files.pythonhosted.org/packages/61/a6/f824b0b8f00273a939b65b08b7c419c89c07b77e2247d196d1d14fb59c10/mockprocess-0.2.tar.gz" } ] }