{ "info": { "author": "Huseyin Yilmaz", "author_email": "yilmazhuseyin@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Placebo |build|_\n================\n\nPlacebo is a utility that help mock api endpoints in a reusable and composable way.\n\n\nTo use placebo first we should create a placebo class for our mock. Placebo class represents a response for certain request. If url and http method of any request matches with mock, response that is described in placebo class will be return. We can create a placebo mock like this:\n\n::\n\n from placebo import Placebo\n\n class UsersResponse(Placebo):\n url = 'http://www.acme.com/api/v1/users/'\n body = json.dumps([{'name': 'Huseyin',\n 'last_name': 'Yilmaz'}])\n\nMain interface for a placebo object is a decorator. Any function that decorated with a placebo class will be mocked with that placebo class.\n\n::\n\n @UserResponse.decorate\n def users_api_test(self):\n ...\n\n\nYou can decorate any function or method with this decorator. Even django views! This makes development against external apis very easy.\n\n::\n\n @UserResponse.decorate\n def users_list_view(request):\n ...\n\nIf your code is using multiple api endpoints you can easily stack placebo decorators on top of each other.\n\n::\n\n @AuthResponse.decorate\n @UserResponse.decorate\n def test_valid_get_user(request):\n ...\n\n @AuthResponse.decorate(status=401)\n @UserResponse.decorate\n def test_cannot_authenticate(request):\n ...\n\n @AuthResponse.decorate\n @UserResponse.decorate(status=503)\n def test_api_is_not_available(request):\n ...\n\n\nFor more information, please refer to documentation_\n\n\n.. |build| image:: https://travis-ci.org/huseyinyilmaz/placebo.svg?branch=master\n.. _build: https://travis-ci.org/huseyinyilmaz/placebo\n\n.. _documentation: http://placebo.readthedocs.io/en/latest/\n", "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/huseyinyilmaz/placebo", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "python-placebo", "package_url": "https://pypi.org/project/python-placebo/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/python-placebo/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/huseyinyilmaz/placebo" }, "release_url": "https://pypi.org/project/python-placebo/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Placebo is a tool for mocking external API's in python applications.", "version": "1.0.1" }, "last_serial": 2279894, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4dfe5f670e6e759d99a9bef2ca4de2d0", "sha256": "e650aafd824f6eff693066ff818ed1b0f58a14de31bc2e6fd2ed86fc29f686e9" }, "downloads": -1, "filename": "python-placebo-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4dfe5f670e6e759d99a9bef2ca4de2d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8404, "upload_time": "2016-08-13T19:02:22", "url": "https://files.pythonhosted.org/packages/f7/4b/d23f783f01b81c7c5bcf40a16b02903767b341f8cefbc3d775129199192e/python-placebo-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "264f0df1248fd63884d7d0767edf9b5e", "sha256": "271b3692fea5a45c918c9c4fa26fb90bbe921788336dd211b9506fdeda924e2a" }, "downloads": -1, "filename": "python-placebo-1.0.1.tar.gz", "has_sig": false, "md5_digest": "264f0df1248fd63884d7d0767edf9b5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7875, "upload_time": "2016-08-13T20:14:36", "url": "https://files.pythonhosted.org/packages/e9/97/7ef9683099972fc33c6ecf85fccb9f14dfc0891a27fa68a679d8a8b1a491/python-placebo-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "264f0df1248fd63884d7d0767edf9b5e", "sha256": "271b3692fea5a45c918c9c4fa26fb90bbe921788336dd211b9506fdeda924e2a" }, "downloads": -1, "filename": "python-placebo-1.0.1.tar.gz", "has_sig": false, "md5_digest": "264f0df1248fd63884d7d0767edf9b5e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7875, "upload_time": "2016-08-13T20:14:36", "url": "https://files.pythonhosted.org/packages/e9/97/7ef9683099972fc33c6ecf85fccb9f14dfc0891a27fa68a679d8a8b1a491/python-placebo-1.0.1.tar.gz" } ] }