[Mod] sendRequest改名为sendPacket

和onPacket对应。
This commit is contained in:
nanoric 2018-10-15 04:37:43 -04:00
parent 4d7c3bf417
commit c50c31a6bd
2 changed files with 2 additions and 2 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)