Merge branch 'refactor.network.devel' into okex.devel
This commit is contained in:
commit
90d25fa536
@ -38,7 +38,7 @@ class WebsocketClientTest(unittest.TestCase):
|
|||||||
req = {
|
req = {
|
||||||
'name': 'val'
|
'name': 'val'
|
||||||
}
|
}
|
||||||
self.c.sendRequest(req)
|
self.c.sendPacket(req)
|
||||||
res = self.c.p.get(3)
|
res = self.c.p.get(3)
|
||||||
|
|
||||||
self.assertEqual(res, req)
|
self.assertEqual(res, req)
|
||||||
|
@ -55,7 +55,7 @@ class WebsocketClient(object):
|
|||||||
self._disconnect()
|
self._disconnect()
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def sendRequest(self, dictObj): # type: (dict)->None
|
def sendPacket(self, dictObj): # type: (dict)->None
|
||||||
"""发出请求:相当于sendText(json.dumps(dictObj))"""
|
"""发出请求:相当于sendText(json.dumps(dictObj))"""
|
||||||
return self._get_ws().send(json.dumps(dictObj), opcode=websocket.ABNF.OPCODE_TEXT)
|
return self._get_ws().send(json.dumps(dictObj), opcode=websocket.ABNF.OPCODE_TEXT)
|
||||||
|
|
||||||
@ -154,7 +154,6 @@ class WebsocketClient(object):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
@abstractmethod
|
|
||||||
def onError(self, exceptionType, exceptionValue, tb):
|
def onError(self, exceptionType, exceptionValue, tb):
|
||||||
"""Python错误回调"""
|
"""Python错误回调"""
|
||||||
pass
|
return sys.excepthook(exceptionType, exceptionValue, tb)
|
||||||
|
Loading…
Reference in New Issue
Block a user