diff --git a/tests/api/base/WebSocketClientTest.py b/tests/api/base/WebSocketClientTest.py index 1bf1b923..dc9651dd 100644 --- a/tests/api/base/WebSocketClientTest.py +++ b/tests/api/base/WebSocketClientTest.py @@ -38,7 +38,7 @@ class WebsocketClientTest(unittest.TestCase): req = { 'name': 'val' } - self.c.sendRequest(req) + self.c.sendPacket(req) res = self.c.p.get(3) self.assertEqual(res, req) diff --git a/vnpy/api/websocket/WebSocketClient.py b/vnpy/api/websocket/WebSocketClient.py index 750a593f..9ae7cafb 100644 --- a/vnpy/api/websocket/WebSocketClient.py +++ b/vnpy/api/websocket/WebSocketClient.py @@ -55,7 +55,7 @@ class WebsocketClient(object): self._disconnect() #---------------------------------------------------------------------- - def sendRequest(self, dictObj): # type: (dict)->None + def sendPacket(self, dictObj): # type: (dict)->None """发出请求:相当于sendText(json.dumps(dictObj))""" return self._get_ws().send(json.dumps(dictObj), opcode=websocket.ABNF.OPCODE_TEXT)