Skip to main content

A utility for mocking out the Python httpx library.

Project description

respx

codecov PyPi Version Python Versions

A utility for mocking out the Python httpx library.

import httpx
import respx

@respx.activate
def test_something():
    request = respx.post("https://foo.bar/baz/", status_code=201)
    response = httpx.post("https://foo.bar/baz/")
    assert request.called
    assert response.status_code == 201

with respx.activate():
    request = respx.get("https://foo.bar/", content={"foo": "bar"})
    response = httpx.get("https://foo.bar/")
    assert request.called
    assert response.json() == {"foo": "bar"}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

respx-0.4.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

respx-0.4-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file respx-0.4.tar.gz.

File metadata

  • Download URL: respx-0.4.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.0

File hashes

Hashes for respx-0.4.tar.gz
Algorithm Hash digest
SHA256 bfafb8f7271001275d94ebdd2cf867e77d82eeea2249135aeb5a4277839012df
MD5 9e5ec108906c0b4533b0ef628f494cec
BLAKE2b-256 0192018a22039bb50cc719d6151e3b9554fdf7ea742c27934d28d511acd682fa

See more details on using hashes here.

File details

Details for the file respx-0.4-py3-none-any.whl.

File metadata

  • Download URL: respx-0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.0

File hashes

Hashes for respx-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 35e2b178599efea32c2c6424e0e97bffd802b8150df801929e538f99a0c56a3b
MD5 ee63849801f883bcf11feee5d4d8795c
BLAKE2b-256 88b160bbe6c9adac6dc44b34bd68779aa25d319d14d8c710b8a6acbb20fc9b65

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page