winIDEA SDK
Loading...
Searching...
No Matches
test_remove.py
# This script is licensed under BSD License, see file LICENSE.txt, or search for `License` in the SDK online help.
#
# (c) TASKING Germany GmbH, 2023
import os
import isystem.connect as ic
winidea_id = ''
def test_remove():
connMgr = ic.ConnectionMgr()
# normally, here you would do connection to a remote winIDEA
# for this test, local winIDEA is used
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
rfCtrl = ic.CRemoteFileController(connMgr)
print(f"Writing local 'main.cpp' file to remote...")
wksFolderPath = ic.CIDEController(connMgr).getPath(ic.CIDEController.WORKSPACE_DIR)
localFilePath = os.path.join(wksFolderPath, "src", "main.cpp")
remoteFilePath = os.path.join(wksFolderPath, "remoteTestFile.txt")
rfCtrl.writeToRemote(localFilePath, remoteFilePath)
print(f"Removing remote file: {remoteFilePath}")
rfCtrl.remove(remoteFilePath)
if __name__ == "__main__":
test_remove()