Skip to main content

Check HTTP response status

Project description

Checks your HTTP response has the expected status, throws an error if not:

>>> response = esc.expect(404, requests.get("http://example.com"))
esc.UnexpectedStatusCode: Expected one of HTTP 404, but http://example.com/ returned 200 with content: <!doctype html>

Why?

  1. Status code checks are ever so slightly easier.

  2. Unit test failure messages are far more helpful.

Supported libraries

Currently supports the following:

  • requests

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

esc-0.1.tar.gz (2.2 kB view details)

Uploaded Source

File details

Details for the file esc-0.1.tar.gz.

File metadata

  • Download URL: esc-0.1.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for esc-0.1.tar.gz
Algorithm Hash digest
SHA256 761c5925908a4494c91c668ea3d2c8856513e07227536066a5c17c5a1e7c52f7
MD5 ec223912467b8784bd180d5d7c833ed8
BLAKE2b-256 682308b611051c1b5abdccd3312d7c949cffba7016e2e8b67f8bd45531ad4af0

See more details on using hashes here.

Supported by

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