mirror of
https://github.com/openwrt/packages.git
synced 2026-10-14 22:56:46 +04:00
python-pika: add test script
Add a CI test.sh exercising basic package functionality.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
(cherry picked from commit bdef92ab04)
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
This commit is contained in:
1 parent
f7640dcf59
commit
5811127331
1 file changed
+18
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$1" = python3-pika ] || exit 0
|
||||
|
||||
python3 - << 'EOF'
|
||||
|
||||
import pika
|
||||
|
||||
# No broker required: parse an AMQP URL and build message properties, which
|
||||
# exercises the URL parameter parser and the pika.spec frame classes.
|
||||
p = pika.URLParameters("amqp://user:pass@host:5672/vhost")
|
||||
assert p.host == "host" and p.port == 5672
|
||||
assert p.credentials.username == "user"
|
||||
|
||||
props = pika.BasicProperties(content_type="text/plain", delivery_mode=2)
|
||||
assert props.content_type == "text/plain" and props.delivery_mode == 2
|
||||
|
||||
EOF
|
||||
Reference in new issue
Block a user