awesome-repositories.com
Blog
awesome-repositories.com

Découvrez les meilleurs dépôts open-source grâce à notre recherche par IA.

ExplorerRecherches sélectionnéesAlternatives open sourceLogiciels auto-hébergésBlogPlan du site
ProjetÀ proposNotre méthodologiePresseServeur MCP
Mentions légalesConfidentialitéConditions d'utilisation
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
getsentry avatar

getsentry/responses

0
View on GitHub↗
4,350 stars·368 forks·Python·Apache-2.0·2 vues

Responses

Responses est une bibliothèque de mocking Python conçue pour intercepter les appels HTTP sortants effectués avec la bibliothèque Requests afin de renvoyer des réponses simulées prédéfinies. Elle fonctionne comme un framework de vérification de requêtes et un outil de simulation réseau, permettant de vérifier le comportement de l'application face à divers modèles de réponse API sans effectuer de réels appels réseau.

Le projet se distingue par un enregistreur de trafic qui capture les interactions réseau réelles et les enregistre dans des fichiers pour une relecture déterministe. Il permet en outre la simulation de scénarios réseau complexes, y compris le déclenchement de timeouts de connexion, d'erreurs réseau et de redirections HTTP.

La bibliothèque fournit des capacités de simulation d'API dynamique utilisant des réponses basées sur des callbacks et des files d'attente de réponses séquentielles pour tester les changements d'état. Elle inclut des outils pour la vérification des données de requête et la validation des attributs afin de s'assurer que les en-têtes, corps et paramètres de requête sortants répondent aux critères attendus.

Les configurations de mock et les registres sont gérés via des décorateurs et des gestionnaires de contexte pour isoler les comportements entre les cas de test.

Features

  • API Request Mocking - Intercepts outgoing HTTP calls made with the Python Requests library to return predefined simulated responses.
  • HTTP Mock Servers - Intercepts outgoing requests to specific URLs and returns predefined status codes, headers, and bodies to simulate a server.
  • Traffic Serialization - Persists captured network responses to structured files on disk for offline playback.
  • Request Matching Engines - Uses a lookup table of URL patterns and HTTP methods to resolve incoming requests to simulated responses.
  • Module Monkey Patching - Replaces the internal request methods of the Requests library to divert traffic to a mock registry.
  • Python HTTP Mocking Libraries - Provides a specialized library for intercepting and mocking HTTP calls within Python applications using the Requests library.
  • API Response Recordings - Captures real API responses from a server and saves them to files for deterministic replay in tests.
  • API Integration Testing - Provides tools to verify that applications correctly send requests and handle various server responses using mock data.
  • API Simulation and Mocking - Implements flexible mock servers that generate different responses based on request bodies, headers, or sequences.
  • Request Verification - Includes a framework for asserting that outgoing requests contain the expected headers, bodies, and query parameters.
  • Mock Registry Management - Add, replace, or remove registered mock data dynamically during test execution to simulate different server scenarios.
  • Network Failure Simulations - Simulates network-level errors such as connection timeouts and failures to verify application resilience.
  • Sequential Response Queues - Maintains an ordered queue of responses for a single endpoint to simulate evolving server states.
  • Exception Simulation Utilities - Triggers specific Python exceptions instead of standard HTTP responses to test application error handling.
  • Predicate-Based Validations - Matches requests using custom logic and predicates applied to headers, bodies, and query parameters.
  • Context Managers - Implements Python decorators and context managers to isolate mock configurations and reset the registry between tests.
  • Dynamic Response Callbacks - Provides callback functions that generate mock HTTP responses based on incoming request data.
  • Response Sequencing - Returns a sequence of different responses for the same URL to test state changes and retry logic.
  • HTTP Traffic Recording - Captures real network interactions and saves them to files for deterministic replay in test suites.
  • Lifecycle Management - Provides automated handling of mock setup, teardown, and state resetting using decorators and context managers.
  • Network Request Assertions - Verifies that specific network requests were executed and tracks the number of times they were called.
  • Outgoing Request Validation - Validates that outgoing HTTP request bodies and headers match expected schemas or criteria.
  • Mocking and Fixtures - Utility for mocking the requests library.
  • Mocking Libraries - Utility for mocking network requests.
  • Testing Tools - Listed in the “Testing Tools” section of the Awesome Python awesome list.

Historique des stars

Graphique de l'historique des stars pour getsentry/responsesGraphique de l'historique des stars pour getsentry/responses

Recherche par IA

Explorez plus de dépôts awesome

Décrivez vos besoins en langage naturel — l'IA classe des milliers de projets open source sélectionnés par pertinence.

Start searching with AI

Alternatives open source à Responses

Projets open source similaires, classés selon le nombre de fonctionnalités partagées avec Responses.
  • pgte/nockAvatar de pgte

    pgte/nock

    13,108Voir sur GitHub↗

    Nock is a Node.js HTTP mocking library used to intercept outgoing network requests and return predefined responses. It functions as a network request interceptor and HTTP mock server, allowing developers to simulate external API behavior for automated testing without making live network calls. The project includes an API fixture recorder to capture real network interactions and save them as reusable data files for playback. It also features a network latency simulator that introduces artificial delays to outgoing HTTP responses to verify timeout handling and race conditions. The library prov

    JavaScript
    Voir sur GitHub↗13,108
  • nock/nockAvatar de nock

    nock/nock

    13,103Voir sur GitHub↗

    nock is a Node.js HTTP mocking library and request interceptor. It captures outgoing network traffic to specific hosts and paths, returning predefined responses to decouple applications from external servers during automated testing. The project functions as an API expectation framework to verify that specific calls were made with correct parameters. It includes a traffic recorder that captures real network interactions as fixtures for playback and a network simulation tool to introduce artificial latency or trigger network errors. Its capabilities cover request matching via hostnames, paths

    JavaScripthttpjavascriptmock
    Voir sur GitHub↗13,103
  • dreamhead/mocoAvatar de dreamhead

    dreamhead/moco

    4,446Voir sur GitHub↗

    moco is a multi-protocol mock server and programmable API stub used to simulate HTTP, REST, WebSocket, and Server-Sent Events endpoints. It enables the creation of fake backend services to facilitate development and integration testing without requiring a live server. The project distinguishes itself through its ability to act as a network traffic replay tool, capturing real request-response pairs via a proxy and playing them back locally. It also supports bidirectional communication simulations, including WebSocket server simulation and SSE stream simulation with configurable delivery delays

    Java
    Voir sur GitHub↗4,446
  • wheresrhys/fetch-mockAvatar de wheresrhys

    wheresrhys/fetch-mock

    1,310Voir sur GitHub↗

    Fetch-mock is a testing utility designed to isolate application code from external network dependencies by intercepting and overriding outgoing traffic. It functions as a network request interceptor that captures calls made via the Fetch API, allowing developers to simulate server responses and verify application behavior without requiring a live backend infrastructure. The library distinguishes itself through a unified interface that provides consistent network interception logic across diverse runtime environments, including browsers, service workers, and server-side platforms. By replacing

    JavaScript
    Voir sur GitHub↗1,310
Voir les 30 alternatives à Responses→

Questions fréquentes

Que fait getsentry/responses ?

Responses est une bibliothèque de mocking Python conçue pour intercepter les appels HTTP sortants effectués avec la bibliothèque Requests afin de renvoyer des réponses simulées prédéfinies. Elle fonctionne comme un framework de vérification de requêtes et un outil de simulation réseau, permettant de vérifier le comportement de l'application face à divers modèles de réponse API sans effectuer de réels appels réseau.

Quelles sont les fonctionnalités principales de getsentry/responses ?

Les fonctionnalités principales de getsentry/responses sont : API Request Mocking, HTTP Mock Servers, Traffic Serialization, Request Matching Engines, Module Monkey Patching, Python HTTP Mocking Libraries, API Response Recordings, API Integration Testing.

Quelles sont les alternatives open-source à getsentry/responses ?

Les alternatives open-source à getsentry/responses incluent : pgte/nock — Nock is a Node.js HTTP mocking library used to intercept outgoing network requests and return predefined responses. It… nock/nock — nock is a Node.js HTTP mocking library and request interceptor. It captures outgoing network traffic to specific hosts… dreamhead/moco — moco is a multi-protocol mock server and programmable API stub used to simulate HTTP, REST, WebSocket, and Server-Sent… wheresrhys/fetch-mock — Fetch-mock is a testing utility designed to isolate application code from external network dependencies by… alisoftware/ohhttpstubs — OHHTTPStubs is an HTTP network mocking library and request interceptor used to simulate server responses for testing… bblimke/webmock — WebMock is a Ruby library for HTTP request stubbing, response simulation, and network interception. It serves as a…