diff options
author | Yonatan Goldschmidt <yon.goldschmidt@gmail.com> | 2019-02-10 22:35:18 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2019-02-14 00:35:45 +1100 |
commit | bc4f8b438b56cf1b4f6b44febcd0d83599cbbd68 (patch) | |
tree | 48a549df981c2471d12cdbe9f135f90b37cf9878 /tests/extmod/websocket_basic.py | |
parent | d1acca3c71780545e067e85b444b495cc9801b2b (diff) | |
download | micropython-bc4f8b438b56cf1b4f6b44febcd0d83599cbbd68.tar.gz micropython-bc4f8b438b56cf1b4f6b44febcd0d83599cbbd68.zip |
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`.
Diffstat (limited to 'tests/extmod/websocket_basic.py')
-rw-r--r-- | tests/extmod/websocket_basic.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/extmod/websocket_basic.py b/tests/extmod/websocket_basic.py index 9a80503a03..6cc6f0fd15 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)) |