Modify testAction command to use handleRequest instead of directly calling the function
This commit is contained in:
parent
fa970fa102
commit
c5116fb318
1 changed files with 3 additions and 4 deletions
|
@ -335,9 +335,8 @@ def ui_websocket(site, user):
|
|||
ui_websocket = UiWebsocket(ws_mock, site, None, user, None)
|
||||
|
||||
def testAction(action, *args, **kwargs):
|
||||
func = getattr(ui_websocket, "action%s" % action)
|
||||
func(0, *args, **kwargs)
|
||||
return ui_websocket.ws.result.get()
|
||||
ui_websocket.handleRequest({"id": 0, "cmd": action, "params": list(args) if args else kwargs})
|
||||
return ui_websocket.ws.getResult()
|
||||
|
||||
ui_websocket.testAction = testAction
|
||||
return ui_websocket
|
||||
|
|
Loading…
Reference in a new issue