Merge branch 'refactor.network.devel' into okex.devel

This commit is contained in:
nanoric 2018-10-15 04:39:39 -04:00
commit 90d25fa536
2 changed files with 3 additions and 4 deletions

View File

@ -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)

View File

@ -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)
@ -154,7 +154,6 @@ class WebsocketClient(object):
pass
#----------------------------------------------------------------------
@abstractmethod
def onError(self, exceptionType, exceptionValue, tb):
"""Python错误回调"""
pass
return sys.excepthook(exceptionType, exceptionValue, tb)