{ "info": { "author": "Bob McKee", "author_email": "bmckee@bywires.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Chara\n\n\nChara enables developers to quickly create characterization tests. Start by creating integration tests using whatever testing framework you prefer. Using Chara you decorate those test functions to record interactions with specific dependencies. Afterwards, you can replay the recording and those dependencies will behave as recorded.\n\n## Usage\n\nCreate production code and passing integration test (test_scraper.py)::\n\n def scrape_headline(name):\n url, search = {\n 'wired': (\n 'http://www.wired.com', \n '
\\s*'\n '
[^<]*
\\s*'\n '

\\s*]*>([^<]*?)\\s*

\\s*'\n '
'\n )\n }[name]\n\n matches = re.search(search, get_html(url))\n\n return matches.group(1) if matches else None\n\n\n def get_html(url):\n return urllib2.urlopen(url).read()\n\n\n class DemoTest(TestCase):\n def test_scraper(self):\n self.assertEqual(\n 'This Is What Happens When You Hack and '\n 'Extort the \\'Bitcoin Jesus\\'',\n scrape_headline('wired')\n )\n\nAdd chara.record decorator and run the test::\n\n class DemoTest(TestCase):\n @chara.record('test_scraper.get_html')\n def test_scraper(self):\n self.assertEqual(\n 'This Is What Happens When You Hack and '\n 'Extort the \\'Bitcoin Jesus\\'',\n scrape_headline('wired')\n )\n\nSwitch to using chara.replay and notice that even if you turn get_html() to a no-op function the test still passes, so you know that the function's normal functionality is being bypassed by Chara's replay functionality.::\n\n def get_html(url):\n pass # nothing even happening here, but the test passes!\n\n class DemoTest(TestCase):\n @chara.replay('test_scraper.get_html')\n def test_scraper(self):\n self.assertEqual(\n 'This Is What Happens When You Hack and '\n 'Extort the \\'Bitcoin Jesus\\'',\n scrape_headline('wired')\n )\n\n\n\n## License\n\nUses the [MIT](http://opensource.org/licenses/MIT) license.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/bywires/chara/tarball/0.1.5", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/bywires/chara", "keywords": "record,replay,spy,test", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "chara", "package_url": "https://pypi.org/project/chara/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/chara/", "project_urls": { "Download": "https://github.com/bywires/chara/tarball/0.1.5", "Homepage": "https://github.com/bywires/chara" }, "release_url": "https://pypi.org/project/chara/0.1.5/", "requires_dist": null, "requires_python": null, "summary": "Chara enables developers to quickly create characterization tests. Start by creating integration tests using whatever testing framework you prefer. Using Chara you decorate those test functions to record interactions with specific dependencies. Afterwards, you can replay the recording and those dependencies will behave as recorded.", "version": "0.1.5" }, "last_serial": 1109142, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "ca9e5146dc809d0d42a83b3def9000bc", "sha256": "6163e56a40c28fc64df68706bb74214de2bddcad40e13cb851dd03e00bf81943" }, "downloads": -1, "filename": "chara-0.1.1.tar.gz", "has_sig": false, "md5_digest": "ca9e5146dc809d0d42a83b3def9000bc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7469, "upload_time": "2014-05-30T01:28:43", "url": "https://files.pythonhosted.org/packages/99/d2/7b7f420801e42651ba1b46448ea77d4bcdbf969726890e33ded781839058/chara-0.1.1.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "0c669a6c2c58ea13b07f3be33d188272", "sha256": "6aedd8022d50cbeeba5207a25b8b506b71dfc627a46ad55ef851f1ccab42d0bc" }, "downloads": -1, "filename": "chara-0.1.4.tar.gz", "has_sig": false, "md5_digest": "0c669a6c2c58ea13b07f3be33d188272", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7686, "upload_time": "2014-05-30T19:03:04", "url": "https://files.pythonhosted.org/packages/13/3f/1f8553fae84d71309e42a8d4d32aae2aed9fc29e001946cd93c2a26b2d4f/chara-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "b4b325a75a6821c26902ae87fd319bc0", "sha256": "37b687d5e5e5a51ab4087f9c52d2c9dc5fd6efb47b0e49f5d678bc7a715ee9ef" }, "downloads": -1, "filename": "chara-0.1.5.tar.gz", "has_sig": false, "md5_digest": "b4b325a75a6821c26902ae87fd319bc0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7686, "upload_time": "2014-05-30T19:04:29", "url": "https://files.pythonhosted.org/packages/99/8a/017bf32e4864ed6d9bb585cc8e98554d70f87272644c27b4e6a8eca157ab/chara-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b4b325a75a6821c26902ae87fd319bc0", "sha256": "37b687d5e5e5a51ab4087f9c52d2c9dc5fd6efb47b0e49f5d678bc7a715ee9ef" }, "downloads": -1, "filename": "chara-0.1.5.tar.gz", "has_sig": false, "md5_digest": "b4b325a75a6821c26902ae87fd319bc0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7686, "upload_time": "2014-05-30T19:04:29", "url": "https://files.pythonhosted.org/packages/99/8a/017bf32e4864ed6d9bb585cc8e98554d70f87272644c27b4e6a8eca157ab/chara-0.1.5.tar.gz" } ] }