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
|
@ -38,7 +38,7 @@ else:
|
||||||
CHROMEDRIVER_PATH = "chromedriver"
|
CHROMEDRIVER_PATH = "chromedriver"
|
||||||
SITE_URL = "http://127.0.0.1:43110"
|
SITE_URL = "http://127.0.0.1:43110"
|
||||||
|
|
||||||
TEST_DATA_PATH = 'src/Test/testdata'
|
TEST_DATA_PATH = 'src/Test/testdata'
|
||||||
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "/../lib")) # External modules directory
|
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "/../lib")) # External modules directory
|
||||||
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "/..")) # Imports relative to src dir
|
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + "/..")) # Imports relative to src dir
|
||||||
|
|
||||||
|
@ -335,9 +335,8 @@ def ui_websocket(site, user):
|
||||||
ui_websocket = UiWebsocket(ws_mock, site, None, user, None)
|
ui_websocket = UiWebsocket(ws_mock, site, None, user, None)
|
||||||
|
|
||||||
def testAction(action, *args, **kwargs):
|
def testAction(action, *args, **kwargs):
|
||||||
func = getattr(ui_websocket, "action%s" % action)
|
ui_websocket.handleRequest({"id": 0, "cmd": action, "params": list(args) if args else kwargs})
|
||||||
func(0, *args, **kwargs)
|
return ui_websocket.ws.getResult()
|
||||||
return ui_websocket.ws.result.get()
|
|
||||||
|
|
||||||
ui_websocket.testAction = testAction
|
ui_websocket.testAction = testAction
|
||||||
return ui_websocket
|
return ui_websocket
|
||||||
|
|
Loading…
Reference in a new issue