{"id":13501897,"url":"https://github.com/gabrielfalcao/HTTPretty","last_synced_at":"2025-03-29T10:32:28.687Z","repository":{"id":1355366,"uuid":"1303056","full_name":"gabrielfalcao/HTTPretty","owner":"gabrielfalcao","description":"Intercept HTTP requests at the Python socket level. Fakes the whole socket module","archived":false,"fork":false,"pushed_at":"2024-06-09T14:37:11.000Z","size":1118,"stargazers_count":2123,"open_issues_count":126,"forks_count":278,"subscribers_count":43,"default_branch":"main","last_synced_at":"2025-03-25T16:16:55.702Z","etag":null,"topics":["decorators","fakeweb","http","httpretty","mock","mocking","python","python2","streaming-response","tdd","testing","testing-tools"],"latest_commit_sha":null,"homepage":"https://httpretty.readthedocs.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielfalcao.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://xscode.com/gabrielfalcao/HTTPretty"]}},"created_at":"2011-01-28T14:59:02.000Z","updated_at":"2025-03-25T14:04:41.000Z","dependencies_parsed_at":"2024-04-28T01:57:16.752Z","dependency_job_id":"4e8ec3ae-256f-4b08-a824-223f23787846","html_url":"https://github.com/gabrielfalcao/HTTPretty","commit_stats":{"total_commits":555,"total_committers":106,"mean_commits":5.235849056603773,"dds":0.4162162162162162,"last_synced_commit":"f9f012711597634d40066d144a36888b3addcc46"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielfalcao%2FHTTPretty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielfalcao%2FHTTPretty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielfalcao%2FHTTPretty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielfalcao%2FHTTPretty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielfalcao","download_url":"https://codeload.github.com/gabrielfalcao/HTTPretty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174014,"owners_count":20735406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decorators","fakeweb","http","httpretty","mock","mocking","python","python2","streaming-response","tdd","testing","testing-tools"],"created_at":"2024-07-31T22:01:54.656Z","updated_at":"2025-03-29T10:32:28.383Z","avatar_url":"https://github.com/gabrielfalcao.png","language":"Python","funding_links":["https://xscode.com/gabrielfalcao/HTTPretty"],"categories":["Testing","Python","测试","Uncategorized","Mock and Stub","File Manipulation","Testing [🔝](#readme)","Awesome Python"],"sub_categories":["Uncategorized","HTTP Clients","Testing"],"readme":"HTTPretty 1.1.4\n===============\n\n.. image:: https://github.com/gabrielfalcao/HTTPretty/raw/master/docs/source/_static/logo.svg?sanitize=true\n\nHTTP Client mocking tool for Python created by `Gabriel Falcão \u003chttps://github.com/gabrielfalcao\u003e`_ . It provides a full fake TCP socket module. Inspired by `FakeWeb \u003chttps://github.com/chrisk/fakeweb\u003e`_\n\n\n- `Github Repository \u003chttps://github.com/gabrielfalcao/HTTPretty\u003e`_\n- `Documentation \u003chttps://httpretty.readthedocs.io/en/latest/\u003e`_\n- `PyPI Package \u003chttps://pypi.org/project/httpretty/\u003e`_\n\n\n**Python Support:**\n\n- **3.6**\n- **3.7**\n- **3.8**\n- **3.9**\n\n.. image:: https://img.shields.io/pypi/dm/HTTPretty\n   :target: https://pypi.org/project/HTTPretty\n\n.. image:: https://img.shields.io/codecov/c/github/gabrielfalcao/HTTPretty\n   :target: https://codecov.io/gh/gabrielfalcao/HTTPretty\n\n.. image:: https://img.shields.io/github/workflow/status/gabrielfalcao/HTTPretty/HTTPretty%20Tests?label=Python%203.6%20-%203.9\n   :target: https://github.com/gabrielfalcao/HTTPretty/actions\n\n.. image:: https://img.shields.io/readthedocs/httpretty\n   :target: https://httpretty.readthedocs.io/\n\n.. image:: https://img.shields.io/github/license/gabrielfalcao/HTTPretty?label=Github%20License\n   :target: https://github.com/gabrielfalcao/HTTPretty/blob/master/COPYING\n\n.. image:: https://img.shields.io/pypi/v/HTTPretty\n   :target: https://pypi.org/project/HTTPretty\n\n.. image:: https://img.shields.io/pypi/l/HTTPretty?label=PyPi%20License\n   :target: https://pypi.org/project/HTTPretty\n\n.. image:: https://img.shields.io/pypi/format/HTTPretty\n   :target: https://pypi.org/project/HTTPretty\n\n.. image:: https://img.shields.io/pypi/status/HTTPretty\n   :target: https://pypi.org/project/HTTPretty\n\n.. image:: https://img.shields.io/pypi/pyversions/HTTPretty\n   :target: https://pypi.org/project/HTTPretty\n\n.. image:: https://img.shields.io/pypi/implementation/HTTPretty\n   :target: https://pypi.org/project/HTTPretty\n\n.. image:: https://img.shields.io/snyk/vulnerabilities/github/gabrielfalcao/HTTPretty\n   :target: https://github.com/gabrielfalcao/HTTPretty/network/alerts\n\n.. image:: https://img.shields.io/github/v/tag/gabrielfalcao/HTTPretty\n   :target: https://github.com/gabrielfalcao/HTTPretty/releases\n\n.. |Join the chat at https://gitter.im/gabrielfalcao/HTTPretty| image:: https://badges.gitter.im/gabrielfalcao/HTTPretty.svg\n   :target: https://gitter.im/gabrielfalcao/HTTPretty?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n\nInstall\n-------\n\n.. code:: bash\n\n   pip install httpretty\n\n\n\nCommon Use Cases\n================\n\n- Test-driven development of API integrations\n- Fake responses of external APIs\n- Record and playback HTTP requests\n\n\nSimple Example\n--------------\n\n.. code:: python\n\n    import sure\n    import httpretty\n    import requests\n\n\n    @httpretty.activate(verbose=True, allow_net_connect=False)\n    def test_httpbin():\n        httpretty.register_uri(\n            httpretty.GET,\n            \"https://httpbin.org/ip\",\n            body='{\"origin\": \"127.0.0.1\"}'\n        )\n\n        response = requests.get('https://httpbin.org/ip')\n        response.json().should.equal({'origin': '127.0.0.1'})\n\n        httpretty.latest_requests().should.have.length_of(1)\n        httpretty.last_request().should.equal(httpretty.latest_requests()[0])\n        httpretty.last_request().body.should.equal('{\"origin\": \"127.0.0.1\"}')\n\n\nchecking multiple responses\n---------------------------\n\n .. code:: python\n\n    @httpretty.activate(verbose=True, allow_net_connect=False)\n    def test_post_bodies():\n        url = 'http://httpbin.org/post'\n        httpretty.register_uri(httpretty.POST, url, status=200)\n        httpretty.register_uri(httpretty.POST, url, status=400)\n        requests.post(url, data={'foo': 'bar'})\n        requests.post(url, data={'zoo': 'zoo'})\n        assert 'foo=bar' in httpretty.latest_requests()[0].body\n        assert 'zoo=bar' in httpretty.latest_requests()[1].body\n\n\nLicense\n=======\n\n::\n\n    \u003cHTTPretty - HTTP client mock for Python\u003e\n    Copyright (C) \u003c2011-2021\u003e Gabriel Falcão \u003cgabriel@nacaolivre.org\u003e\n\n    Permission is hereby granted, free of charge, to any person\n    obtaining a copy of this software and associated documentation\n    files (the \"Software\"), to deal in the Software without\n    restriction, including without limitation the rights to use,\n    copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the\n    Software is furnished to do so, subject to the following\n    conditions:\n\n    The above copyright notice and this permission notice shall be\n    included in all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n    OTHER DEALINGS IN THE SOFTWARE.\n\nMain contributors\n=================\n\nHTTPretty has received `many contributions \u003chttps://github.com/gabrielfalcao/HTTPretty/graphs/contributors\u003e`_\nbut some folks made remarkable contributions and deserve extra credit:\n\n-  Andrew Gross ~\u003e `@andrewgross \u003chttps://github.com/andrewgross\u003e`_\n-  Hugh Saunders ~\u003e `@hughsaunders \u003chttps://github.com/hughsaunders\u003e`_\n-  James Rowe ~\u003e `@JNRowe \u003chttps://github.com/JNRowe\u003e`_\n-  Matt Luongo ~\u003e `@mhluongo \u003chttps://github.com/mhluongo\u003e`_\n-  Steve Pulec ~\u003e `@spulec \u003chttps://github.com/spulec\u003e`_\n-  Miro Hrončok ~\u003e `@hroncok \u003chttps://github.com/hroncok\u003e`_\n-  Mario Jonke ~\u003e `@mariojonke \u003chttps://github.com/mariojonke\u003e`_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielfalcao%2FHTTPretty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielfalcao%2FHTTPretty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielfalcao%2FHTTPretty/lists"}