[Mod] sendRequest改名为sendPacket
和onPacket对应。
This commit is contained in:
parent
4d7c3bf417
commit
c50c31a6bd
@ -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)
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user