winIDEA SDK
test_remove.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import os
6
7import isystem.connect as ic
8
9
10winidea_id = ''
11
12
13def test_remove():
14 connMgr = ic.ConnectionMgr()
15 # normally, here you would do connection to a remote winIDEA
16 # for this test, local winIDEA is used
17 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
18
19 rfCtrl = ic.CRemoteFileController(connMgr)
20
21 print(f"Writing local 'main.cpp' file to remote...")
22 wksFolderPath = ic.CIDEController(connMgr).getPath(ic.CIDEController.WORKSPACE_DIR)
23 localFilePath = os.path.join(wksFolderPath, "src", "main.cpp")
24 remoteFilePath = os.path.join(wksFolderPath, "remoteTestFile.txt")
25 rfCtrl.writeToRemote(localFilePath, remoteFilePath)
26
27 print(f"Removing remote file: {remoteFilePath}")
28 rfCtrl.remove(remoteFilePath)
29
30
31if __name__ == "__main__":
32 test_remove()