winIDEA SDK
test_persistent_vars.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_persistentVars():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 tcCtrl = ic.CTestCaseController(connMgr, "main", "")
16
17 print("Creating a persistent variable...")
18 tcCtrl.createPersistentVariable("persistent_var", "int")
19 tcCtrl.initPersistentVars()
20
21 tcCtrl.init()
22 tcCtrl.destroy()
23 print("Deleting all persistent variables...")
24 tcCtrl.deletePersistentVariable("persistent_var")
25 tcCtrl.commitDeletedVars()
26 tcCtrl.cleanPersistentVars()
27
28 # TODO MK fails, don't know why 'State transition not allowed'. Demo mode?
29
30
31if __name__ == "__main__":
32 test_persistentVars()