webtest-asgi provides integration of WebTest with ASGI applications
Project description
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"}
Project Links
License
MIT licensed. See the bundled LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
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.0.tar.gz
(3.9 kB
view details)
Built Distribution
File details
Details for the file webtest-asgi-1.0.0.tar.gz
.
File metadata
- Download URL: webtest-asgi-1.0.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f8e1d7d460bfc0595d6f01b0398e723a0b8d5deedd1e2a08fbe2abeaf683f69 |
|
MD5 | 51cbdefc845fbaa1e5941c0f8dd7427a |
|
BLAKE2b-256 | 877e6a2f7d1f1b5a395787bcb6f2b97f26339edbfa783068461215145c8f3a0b |
Provenance
File details
Details for the file webtest_asgi-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: webtest_asgi-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.6 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e7de3c071fce61cfe16fb921104c207fb64e596d0009e3e8426ea0f8e63b101 |
|
MD5 | b6e68844db474a9b56d3d9f879ea7cf3 |
|
BLAKE2b-256 | 6f2a4d723b47be6483adaf27c326ae3a6f196b0f0feb23f76bf9da991f43c267 |