Skip to main content

webtest-asgi provides integration of WebTest with ASGI applications

Project description

pypi badge travis-ci status Code style: Black

webtest-asgi provides integration of WebTest with ASGI applications.

Installation

pip install webtest-asgi

Usage

You can use webtest-asgi with any ASGI application. Here is example usage with Starlette.

from starlette.applications import Starlette
from starlette.responses import JSONResponse
from webtest_asgi import TestApp as WebTestApp

app = Starlette()


@app.route("/")
async def homepage(request):
    return JSONResponse({"hello": "world"})


@pytest.fixture()
def testapp():
    return WebTestApp(app)


def test_get_homepage(testapp):
    assert testapp.get("/").json == {"hello": "world"}

License

MIT licensed. See the bundled LICENSE file for more details.

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

webtest-asgi-1.0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

webtest_asgi-1.0.1-py2.py3-none-any.whl (3.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file webtest-asgi-1.0.1.tar.gz.

File metadata

  • Download URL: webtest-asgi-1.0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for webtest-asgi-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7047bbc453fc2f8408784d9914ff016c0c7e11e9c5d9a745c4b66e4be2a1242b
MD5 8ff2c1911349b810c1d6d141aa830ddc
BLAKE2b-256 795170c27d5c3ef02b08ac7b09dbe2070f9502d324d25468e96579562f2e7370

See more details on using hashes here.

File details

Details for the file webtest_asgi-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: webtest_asgi-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.3

File hashes

Hashes for webtest_asgi-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 36c638a5e0565fac39a6536d6930081925b5f0d69d3aa7d15acd704208f6bd68
MD5 a37e52647b0a86d045d7de3364d68f60
BLAKE2b-256 f4a1fb888e151ebb11e2d7d084386a228cac993f4fefe629ce605dfef833a8ad

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