5import isystem.connect
as ic
14def test_getActiveStub():
15 connMgr = ic.ConnectionMgr()
16 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
18 execCtrl = ic.CExecutionController(connMgr)
19 session = ic.CSessionCtrl(connMgr)
20 session.begin_program()
21 execCtrl.runUntilFunction(
'main')
22 execCtrl.waitUntilStopped()
24 tcCtrl = ic.CTestCaseController(connMgr,
"getNumber",
"")
25 tcCtrl.createParameter(0,
"x")
26 print(
"Creating stub ...")
27 tcCtrl.createStub(
'timesTwo')
31 tcCtrl.waitUntilStopped()
33 tcStatus = tcCtrl.getStatus()
34 print(f
"Current test case state: {ic.CTestCaseController.testState2str(tcStatus)}")
35 if tcStatus == ic.IConnectTest.stateStub:
36 print(f
"Active stub name: {tcCtrl.getActiveStub().getStubName()}")
38 print(
"No active stub...")
41 tcCtrl.waitUntilStopped()
46if __name__ ==
"__main__":