{ "info": { "author": "dvilela", "author_email": "denisxvilela@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Wait for some HTTP response\n===========================\n\nWritten in order to make functional tests less complicated.\n\nRetries a HTTP request until it responds as expected or reaches\nthe max attempt number.\n\n------------------------------------------------------------------\n\nLets say we have an endpoint `http://localhost:8080/health` that give\nus a json, e.g., `{ \"status\": \"UP\" }`. This script keep checking that endpoint\nuntil it receives the `UP` status or it reaches the max number of attempts.\n\n# Install\n\n`pip install wait_response`\n\n# Module\n\nYou can use a function from the module to wait for status responses.\n\n```python\nimport wait_response\nfrom wait_response import wait_response_status\n\n# Make 2 attempts to get status=UP, trying every 1 seconds. \nrespCode = wait_response_status('http://localhost:8080/health', 2, 1, 'UP')\nprint(respCode) # 0 if success or else, 1\n\n```\n\n# Script\n\n`wait_response url [OPTIONS]`\n\n`url` is the required endpoint, e.g., `http://localhost:8080/health`.\n\n## Options\n\n* `--max-attempts default=20` The max number of attempts.\n* `--sleep defaul=1` Sleep time, in seconds, between checks.\n* `--status default=UP` The status to wait for. E.g., `GREEN` or `YELLOW`.\n\n# Developing\n\n## Tests\n\nUse `unittest`\n`python -m unittest test.test_wait_response`\n\n## Run script\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dvilela/wait_response", "keywords": "http response wait-for wait functional test", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "wait-response", "package_url": "https://pypi.org/project/wait-response/", "platform": "", "project_url": "https://pypi.org/project/wait-response/", "project_urls": { "Homepage": "https://github.com/dvilela/wait_response" }, "release_url": "https://pypi.org/project/wait-response/1.0.0/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "Wait for some http response", "version": "1.0.0" }, "last_serial": 3295042, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "ffed9d19dd0fb9cde6ef9240d8fb5ba2", "sha256": "a3efbb9f6acb476ec09f24b6f5528c7df431bb653fb0a00ef58c8377fd95747c" }, "downloads": -1, "filename": "wait_response-1.0.0-py2.7.egg", "has_sig": false, "md5_digest": "ffed9d19dd0fb9cde6ef9240d8fb5ba2", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 6309, "upload_time": "2017-10-31T18:05:04", "url": "https://files.pythonhosted.org/packages/99/60/8e65822415840de80fa0d2038b8d4ed05293de9ddf997e0c7980c6f3e410/wait_response-1.0.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "b416f5a06d442daf9001bf2db0413407", "sha256": "e9dfaf53d04f42950ce3ac70e85e7d81a91ecca5c8358b44aa1118ad2b0aa58e" }, "downloads": -1, "filename": "wait_response-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b416f5a06d442daf9001bf2db0413407", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5698, "upload_time": "2017-10-31T18:05:02", "url": "https://files.pythonhosted.org/packages/e4/87/6d044eb88e515089c70edf3dfc283771c08c73effda65b6ff6be4c87c089/wait_response-1.0.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ffed9d19dd0fb9cde6ef9240d8fb5ba2", "sha256": "a3efbb9f6acb476ec09f24b6f5528c7df431bb653fb0a00ef58c8377fd95747c" }, "downloads": -1, "filename": "wait_response-1.0.0-py2.7.egg", "has_sig": false, "md5_digest": "ffed9d19dd0fb9cde6ef9240d8fb5ba2", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 6309, "upload_time": "2017-10-31T18:05:04", "url": "https://files.pythonhosted.org/packages/99/60/8e65822415840de80fa0d2038b8d4ed05293de9ddf997e0c7980c6f3e410/wait_response-1.0.0-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "b416f5a06d442daf9001bf2db0413407", "sha256": "e9dfaf53d04f42950ce3ac70e85e7d81a91ecca5c8358b44aa1118ad2b0aa58e" }, "downloads": -1, "filename": "wait_response-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b416f5a06d442daf9001bf2db0413407", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5698, "upload_time": "2017-10-31T18:05:02", "url": "https://files.pythonhosted.org/packages/e4/87/6d044eb88e515089c70edf3dfc283771c08c73effda65b6ff6be4c87c089/wait_response-1.0.0-py2.py3-none-any.whl" } ] }