From bc4f8b438b56cf1b4f6b44febcd0d83599cbbd68 Mon Sep 17 00:00:00 2001 From: Yonatan Goldschmidt Date: Sun, 10 Feb 2019 22:35:18 +0200 Subject: extmod/moduwebsocket: Refactor `websocket` to `uwebsocket`. As mentioned in #4450, `websocket` was experimental with a single intended user, `webrepl`. Therefore, we'll make this change without a weak link `websocket` -> `uwebsocket`. --- tests/extmod/websocket_basic.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/extmod/websocket_basic.py') diff --git a/tests/extmod/websocket_basic.py b/tests/extmod/websocket_basic.py index 9a80503a0..6cc6f0fd1 100644 --- a/tests/extmod/websocket_basic.py +++ b/tests/extmod/websocket_basic.py @@ -1,20 +1,20 @@ try: import uio import uerrno - import websocket + import uwebsocket except ImportError: print("SKIP") raise SystemExit # put raw data in the stream and do a websocket read def ws_read(msg, sz): - ws = websocket.websocket(uio.BytesIO(msg)) + ws = uwebsocket.websocket(uio.BytesIO(msg)) return ws.read(sz) # do a websocket write and then return the raw data from the stream def ws_write(msg, sz): s = uio.BytesIO() - ws = websocket.websocket(s) + ws = uwebsocket.websocket(s) ws.write(msg) s.seek(0) return s.read(sz) @@ -36,7 +36,7 @@ print(ws_read(b"\x81\x84maskmask", 4)) # close control frame s = uio.BytesIO(b'\x88\x00') # FRAME_CLOSE -ws = websocket.websocket(s) +ws = uwebsocket.websocket(s) print(ws.read(1)) s.seek(2) print(s.read(4)) @@ -46,11 +46,11 @@ print(ws_read(b"\x89\x00\x81\x04ping", 4)) # FRAME_PING print(ws_read(b"\x8a\x00\x81\x04pong", 4)) # FRAME_PONG # close method -ws = websocket.websocket(uio.BytesIO()) +ws = uwebsocket.websocket(uio.BytesIO()) ws.close() # ioctl -ws = websocket.websocket(uio.BytesIO()) +ws = uwebsocket.websocket(uio.BytesIO()) print(ws.ioctl(8)) # GET_DATA_OPTS print(ws.ioctl(9, 2)) # SET_DATA_OPTS print(ws.ioctl(9)) -- cgit v1.2.3