mirror of
https://github.com/openwrt/packages.git
synced 2026-06-01 15:32:05 +08:00
python-pypubsub: update to 4.0.7
- bump 4.0.3 -> 4.0.7 - add python-setuptools-scm/host to PKG_BUILD_DEPENDS - add test.sh Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
committed by
Alexandru Ardelean
parent
a8ddfaf5b3
commit
bff9781478
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "$1" = python3-pypubsub ] || exit 0
|
||||
|
||||
python3 - << 'EOF'
|
||||
from pubsub import pub
|
||||
|
||||
received = []
|
||||
|
||||
def on_message(msg):
|
||||
received.append(msg)
|
||||
|
||||
pub.subscribe(on_message, "test.topic")
|
||||
pub.sendMessage("test.topic", msg="hello")
|
||||
|
||||
assert received == ["hello"], f"Expected ['hello'], got {received}"
|
||||
|
||||
pub.unsubscribe(on_message, "test.topic")
|
||||
pub.sendMessage("test.topic", msg="world")
|
||||
assert received == ["hello"], "Unsubscribed listener should not receive messages"
|
||||
|
||||
print("python3-pypubsub OK")
|
||||
EOF
|
||||
Reference in New Issue
Block a user