webtest-asgi provides integration of WebTest with ASGI applications
Project description
webtest-asgi provides integration of WebTest with ASGI applications.
Disclaimer
You should probably use Starlette’s TestClient instead of this package for testing ASGI applications. This package was created to test webargs-starlette using webargs’ CommonTestCase, which uses WebTest to test common functionality across multiple web frameworks.
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"}
Project Links
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file webtest_asgi-2.0.0.tar.gz.
File metadata
- Download URL: webtest_asgi-2.0.0.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
086bd9dc602980e67bad9554cec9aa8a21aff783a3f8fdb9637b23d9c598d701
|
|
| MD5 |
864432ba0c874cd11f01729d74d382cf
|
|
| BLAKE2b-256 |
e6bacd2a5629037a3f0d2414d5ad4a23ebdfb368190d6cdbcfe6965ff1424c9f
|
Provenance
The following attestation bundles were made for webtest_asgi-2.0.0.tar.gz:
Publisher:
build-release.yml on sloria/webtest-asgi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
webtest_asgi-2.0.0.tar.gz -
Subject digest:
086bd9dc602980e67bad9554cec9aa8a21aff783a3f8fdb9637b23d9c598d701 - Sigstore transparency entry: 213235181
- Sigstore integration time:
-
Permalink:
sloria/webtest-asgi@b32229a970358f13d3350c403de7f3cce3215fa5 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/sloria
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-release.yml@b32229a970358f13d3350c403de7f3cce3215fa5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file webtest_asgi-2.0.0-py3-none-any.whl.
File metadata
- Download URL: webtest_asgi-2.0.0-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
314ada7dc5f096cd3b39c34555bfedd3e0f147aba43dc7d73e90ef38cbf8c26f
|
|
| MD5 |
68adf6bc9d29d8e6cc41e28eb1768967
|
|
| BLAKE2b-256 |
6070c3f9d7b0c92a847c9d7ba828e000ee479f915bbc2aa8af895bf2c5110300
|
Provenance
The following attestation bundles were made for webtest_asgi-2.0.0-py3-none-any.whl:
Publisher:
build-release.yml on sloria/webtest-asgi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
webtest_asgi-2.0.0-py3-none-any.whl -
Subject digest:
314ada7dc5f096cd3b39c34555bfedd3e0f147aba43dc7d73e90ef38cbf8c26f - Sigstore transparency entry: 213235182
- Sigstore integration time:
-
Permalink:
sloria/webtest-asgi@b32229a970358f13d3350c403de7f3cce3215fa5 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/sloria
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-release.yml@b32229a970358f13d3350c403de7f3cce3215fa5 -
Trigger Event:
push
-
Statement type: