{"library":"mocket","title":"Mocket","description":"Mocket is a socket mock framework for Python that allows you to mock socket connections and HTTP calls for testing purposes. It supports gevent, asyncio, and SSL, and provides a high-level API similar to httpretty. Current version is 3.14.1, with regular releases.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install mocket"],"cli":null},"imports":["from mocket import Mocket","from mocket import MocketEntry","from mocket import mocketize","from mocket.plugins.httpretty import httpretty"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from mocket import mocketize, MocketEntry, Mocket\n\n@mocketize\ndef test_http_get():\n    url = \"http://example.com/\"\n    Mocket.register(MocketEntry(url, body=\"mock response\"))\n    import urllib.request\n    response = urllib.request.urlopen(url)\n    assert response.read() == b\"mock response\"\n","lang":"python","description":"Basic usage mocking an HTTP GET request.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}