mirror of
https://github.com/openwrt/packages.git
synced 2026-04-15 19:02:09 +00:00
Changes since 1.7.0: - v1.8.0: Add support for custom socket options and improved proxy handling - v1.9.0: Fix compatibility with Python 3.12+ deprecations - Various bug fixes for connection handling and error reporting Also add test.sh to verify version and core API imports. Link: https://github.com/websocket-client/websocket-client/blob/master/ChangeLog Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
37 lines
722 B
Bash
Executable File
37 lines
722 B
Bash
Executable File
#!/bin/sh
|
|
|
|
[ "$1" = "python3-websocket-client" ] || exit 0
|
|
|
|
python3 - << EOF
|
|
import sys
|
|
import websocket
|
|
|
|
if websocket.__version__ != "$2":
|
|
print("Wrong version: " + websocket.__version__)
|
|
sys.exit(1)
|
|
|
|
# Verify core API is importable
|
|
from websocket import (
|
|
WebSocket,
|
|
WebSocketApp,
|
|
WebSocketConnectionClosedException,
|
|
WebSocketTimeoutException,
|
|
WebSocketBadStatusException,
|
|
create_connection,
|
|
enableTrace,
|
|
)
|
|
|
|
# WebSocket can be instantiated (without connecting)
|
|
ws = WebSocket()
|
|
assert ws is not None
|
|
|
|
# WebSocketApp can be instantiated with just a URL
|
|
app = WebSocketApp("ws://localhost:9999")
|
|
assert app is not None
|
|
|
|
# Trace toggle does not raise
|
|
enableTrace(False)
|
|
|
|
sys.exit(0)
|
|
EOF
|