{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/10"},{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/4"}],"enrichment":{"capability":"Mocket is a socket mocking framework that intercepts and replaces socket and SSL module calls, enabling you to test socket-based clients without real network traffic.","skillfed_tags":["testing-framework","socket-mocking","asyncio-support"],"use_cases":["Test HTTP/HTTPS clients without hitting real endpoints or rate limits.","Mock HTTPS calls with SSL support in unit tests for web service integrations.","Build custom protocol mocks for testing database clients or proprietary socket-based services.","Enforce network isolation in CI/CD by using strict mode to fail tests that leak real socket calls.","Test error paths by mocking socket exceptions and connection failures."],"what_it_does":"Mocket monkey-patches Python's socket and ssl modules to intercept network calls during testing, allowing you to define mock responses without touching the real network. It serves two roles: as a low-level framework for building custom protocol mocks (e.g., for new databases or protocols) and as a ready-to-use HTTP/HTTPS mock. The package includes a basic Redis mock and supports gevent, asyncio, and SSL out of the box.\n\nYou register mock entries with expected URLs, methods, and response bodies, then use a decorator or context manager to activate mocking for your test. Mocket also offers strict mode to fail tests that attempt real network access, and can verify that all registered mock entries were actually used. It depends on decorator, h11, puremagic, typing-extensions, and urllib3 at runtime.","worth_installing":"Yes. Mocket is mature (active maintenance, 312 GitHub stars, no known vulnerabilities), has low install friction, and solves a real testing problem\u2014isolating socket-based code from the network. Use it if you need to mock HTTP clients, test asyncio/gevent code, or build custom protocol mocks. The permissive BSD-3-Clause license poses no restriction."},"id":"mocket","links":{"html":"https://skillfed.io/packages/mocket","md":"https://skillfed.io/packages/mocket.md","pypi":"https://pypi.org/project/mocket/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-13","license_spdx":"BSD-3-Clause","license_treatment":"permissive","name":"mocket","python_support":"supports_current","summary":"Socket Mock Framework - for all kinds of socket animals, web-clients included - with gevent/asyncio/SSL support"},"popularity":{"monthly_downloads":261074,"position":8388,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"3.14.3"}
