All Projects → lundberg → Respx

lundberg / Respx

Licence: bsd-3-clause
Mock HTTPX with awesome request patterns and response side effects 🦋

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Respx

Pytest Responsemock
Simplified requests calls mocking for pytest
Stars: ✭ 24 (-86.89%)
Mutual labels:  requests, mocking
Mocktail
A mock library for Dart inspired by mockito
Stars: ✭ 172 (-6.01%)
Mutual labels:  mocking
Dingo
🐺 Easy, fast and type-safe dependency injection for Go.
Stars: ✭ 154 (-15.85%)
Mutual labels:  mocking
Examples
Examples of Mock Service Worker usage with various frameworks and libraries.
Stars: ✭ 163 (-10.93%)
Mutual labels:  mocking
Httpretty
Intercept HTTP requests at the Python socket level. Fakes the whole socket module
Stars: ✭ 1,930 (+954.64%)
Mutual labels:  mocking
Scrapingoutsourcing
ScrapingOutsourcing专注分享爬虫代码 尽量每周更新一个
Stars: ✭ 164 (-10.38%)
Mutual labels:  requests
Requests Unixsocket
Use requests to talk HTTP via a UNIX domain socket
Stars: ✭ 153 (-16.39%)
Mutual labels:  requests
Xamarin.forms.mocks
Library for running Xamarin.Forms inside of unit tests
Stars: ✭ 179 (-2.19%)
Mutual labels:  mocking
Webcc
Lightweight C++ HTTP client and server library based on Asio for embedding purpose.
Stars: ✭ 167 (-8.74%)
Mutual labels:  requests
Redux Arc
A declarative way to make request with redux actions
Stars: ✭ 162 (-11.48%)
Mutual labels:  requests
Learn2018 Autodown
清华大学新版网络学堂课程自动下载脚本 / A python script to clone all files from learn.tsinghua.edu.cn
Stars: ✭ 160 (-12.57%)
Mutual labels:  requests
Mockito
Most popular Mocking framework for unit tests written in Java
Stars: ✭ 12,453 (+6704.92%)
Mutual labels:  mocking
Jike Metro
🚇 即刻 Ⓙ SDK
Stars: ✭ 165 (-9.84%)
Mutual labels:  requests
Prism
Turn any OpenAPI2/3 and Postman Collection file into an API server with mocking, transformations and validations.
Stars: ✭ 2,484 (+1257.38%)
Mutual labels:  mocking
Torrequest
Simple Python interface for HTTP(s) requests over Tor
Stars: ✭ 175 (-4.37%)
Mutual labels:  requests
Httpmocker
HttpMocker is a simple HTTP mocking library written in Kotlin to quickly and easily handle offline modes in your apps
Stars: ✭ 155 (-15.3%)
Mutual labels:  mocking
Crawlerhot
今日热榜 抓取网站热榜信息,并且前端进行展示
Stars: ✭ 158 (-13.66%)
Mutual labels:  requests
Vcrpy
Automatically mock your HTTP interactions to simplify and speed up testing
Stars: ✭ 2,144 (+1071.58%)
Mutual labels:  mocking
Ioredis Mock
Emulates ioredis by performing all operations in-memory.
Stars: ✭ 181 (-1.09%)
Mutual labels:  mocking
Mocktopus
Mocking framework for Rust
Stars: ✭ 179 (-2.19%)
Mutual labels:  mocking

RESPX

RESPX - Mock HTTPX with awesome request patterns and response side effects.


codecov PyPi Version Python Versions

Documentation

Full documentation is available at lundberg.github.io/respx

QuickStart

RESPX is a simple, yet powerful, utility for mocking out the HTTPX, and HTTP Core, libraries.

Start by patching HTTPX, using respx.mock, then add request routes to mock responses.

import httpx
import respx

from httpx import Response


@respx.mock
def test_example():
    my_route = respx.get("https://example.org/").mock(return_value=Response(204))
    response = httpx.get("https://example.org/")
    assert my_route.called
    assert response.status_code == 204

Read the User Guide for a complete walk-through.

Installation

Install with pip:

$ pip install respx

Requires Python 3.6+ and HTTPX 0.15+. See Changelog for older HTTPX compatibility.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].