mirror of
https://github.com/openwrt/packages.git
synced 2026-10-14 07:46:56 +04:00
python-uvicorn: add test script
Add a CI test.sh exercising basic package functionality. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
1 parent
64b87f0145
commit
d29e862afe
1 file changed
+19
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$1" = python3-uvicorn ] || exit 0
|
||||
|
||||
python3 - << 'EOF'
|
||||
|
||||
import uvicorn
|
||||
|
||||
# Config.load() imports and wires the HTTP/WS protocol backends (h11, etc.)
|
||||
# for a trivial ASGI app - a real functional check that never binds a port.
|
||||
async def app(scope, receive, send):
|
||||
pass
|
||||
|
||||
cfg = uvicorn.Config(app, host="127.0.0.1", port=8000, log_level="warning", loop="asyncio")
|
||||
cfg.load()
|
||||
assert cfg.loaded is True
|
||||
assert uvicorn.Server(cfg).config is cfg
|
||||
|
||||
EOF
|
||||
Reference in new issue
Block a user