{ "info": { "author": "Jordan Sanders", "author_email": "jordan@jordansanders.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Stuboto\n\nStub `boto3` clients to avoid hitting real AWS endpoints in tests.\n\n# Usage\n\nYou can use `Stuboto` instances as if they were `botocore.stub.Stubber`:\n\n```python3\nimport boto3\nfrom stuboto import Stuboto\n\ndef test_create_bucket():\n s3 = boto3.client(\"s3\")\n stubber = Stuboto(s3)\n stubber.activate()\n\n response = {\"Location\": \"my-bucket\"}\n expected_params = {\"Bucket\": \"my-bucket\", \"ACL\": \"private\"}\n\n stubber.add_response(\"create_bucket\", response, expected_params)\n service_response = s3.create_bucket(Bucket=\"my-bucket\", ACL=\"private\")\n assert service_response == response\n```\n\n`Stuboto` instances are decorated with all the same methods as the original `boto3` client so you can also stub responses with the arguably more readable:\n\n```python3\nimport boto3\nfrom stuboto import Stuboto\n\ndef test_create_bucket():\n s3 = boto3.client(\"s3\")\n stubber = Stuboto(s3)\n stubber.activate()\n\n response = stubber.create_bucket(Bucket=\"my-bucket\", ACL=\"private\").add_response(\n Location=\"my-bucket\"\n )\n service_response = s3.create_bucket(Bucket=\"my-bucket\", ACL=\"private\")\n assert service_response == response\n```\n\n`botocore.stub.Stubber` documentation suggests:\n\n> It should be noted, however, that while missing attributes are often considered correct, your code may not function properly if you leave them out. Therefore you should always fill in every value you see in a typical response for your particular request.\n\nBut I won't tell anybody if you leave some values out in favor of writing more readable tests.\n\n## Installation\n\n```bash\npip install stuboto\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jmsanders/stuboto", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "stuboto", "package_url": "https://pypi.org/project/stuboto/", "platform": "", "project_url": "https://pypi.org/project/stuboto/", "project_urls": { "Homepage": "https://github.com/jmsanders/stuboto" }, "release_url": "https://pypi.org/project/stuboto/0.3/", "requires_dist": [ "boto3 (>=1.9.213)" ], "requires_python": "", "summary": "Stub boto3 clients to avoid hitting real AWS endpoints in tests", "version": "0.3" }, "last_serial": 5722632, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "35e69076f044eac5a80ebae0e02fe42b", "sha256": "0c880fd348e17a383a30a276856d2203eab471b47acc2287f9f1e6d476b9060f" }, "downloads": -1, "filename": "stuboto-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "35e69076f044eac5a80ebae0e02fe42b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3375, "upload_time": "2019-08-22T13:41:54", "url": "https://files.pythonhosted.org/packages/b5/4f/b3e78d61062393353c4ac80f47e4cab46088dc182ae254aec9a30ef60733/stuboto-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "833cf6ec065e85c9bcdda3d0cbb64b6d", "sha256": "b55dd538f56188e444e86f3a4f947d6d2186bc8b69952be761e0b69813259e48" }, "downloads": -1, "filename": "stuboto-0.2.tar.gz", "has_sig": false, "md5_digest": "833cf6ec065e85c9bcdda3d0cbb64b6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2252, "upload_time": "2019-08-22T13:41:56", "url": "https://files.pythonhosted.org/packages/fa/13/277abe0db1aadddd22427024a1c6377546d829156c00afe804cf03bea777/stuboto-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "db8eebdbd872e6eac39558f60d24286a", "sha256": "aa3c30758192702fc05120b056a7814dc648b1630eadfeeb9140a820cb995f1d" }, "downloads": -1, "filename": "stuboto-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "db8eebdbd872e6eac39558f60d24286a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3051, "upload_time": "2019-08-23T20:20:01", "url": "https://files.pythonhosted.org/packages/ee/37/e24314b18cecabdf4780a70586d8d2330e2daf8756ecb121a8c7cf5d6acd/stuboto-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b733a0c63d208b702abbe4173cc660b7", "sha256": "8472a4cdb61e9be9f91445550aabb3275fdd3535b533a4d6385253fef03a05a9" }, "downloads": -1, "filename": "stuboto-0.3.tar.gz", "has_sig": false, "md5_digest": "b733a0c63d208b702abbe4173cc660b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2038, "upload_time": "2019-08-23T20:20:03", "url": "https://files.pythonhosted.org/packages/89/ca/adaea4587387ffbccba21d1c813ecdb09d665a642bb134f36a1158f15079/stuboto-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db8eebdbd872e6eac39558f60d24286a", "sha256": "aa3c30758192702fc05120b056a7814dc648b1630eadfeeb9140a820cb995f1d" }, "downloads": -1, "filename": "stuboto-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "db8eebdbd872e6eac39558f60d24286a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3051, "upload_time": "2019-08-23T20:20:01", "url": "https://files.pythonhosted.org/packages/ee/37/e24314b18cecabdf4780a70586d8d2330e2daf8756ecb121a8c7cf5d6acd/stuboto-0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b733a0c63d208b702abbe4173cc660b7", "sha256": "8472a4cdb61e9be9f91445550aabb3275fdd3535b533a4d6385253fef03a05a9" }, "downloads": -1, "filename": "stuboto-0.3.tar.gz", "has_sig": false, "md5_digest": "b733a0c63d208b702abbe4173cc660b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2038, "upload_time": "2019-08-23T20:20:03", "url": "https://files.pythonhosted.org/packages/89/ca/adaea4587387ffbccba21d1c813ecdb09d665a642bb134f36a1158f15079/stuboto-0.3.tar.gz" } ] }