import os
import tempfile
import isystem.connect as ic
winidea_id = ''
def test_exportImportProject():
connMgr = ic.ConnectionMgr()
connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
projCtrl = ic.CProjectController(connMgr)
with tempfile.TemporaryDirectory() as tmpDir:
tmpFilePath = os.path.join(tmpDir, "proj.xml")
print(f"Exporting project to XML: {tmpFilePath}")
if projCtrl.exportProject(tmpFilePath) == -1:
print(f"\tWarnings: {projCtrl.getWarningMessage()}")
print(f"Importing project from XML: {tmpFilePath}")
if projCtrl.exportProject(tmpFilePath) == -1:
print(f"\tWarnings: {projCtrl.getWarningMessage()}")
if __name__ == "__main__":
test_exportImportProject()