-# Copyright (C) 2021 CEA/DEN, EDF R&D
+# Copyright (C) 2021-2023 CEA, EDF
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-import os
+import os, inspect
from salome.shaper import model
+from PyQt5.Qt import QApplication
+
import salome
+salome.salome_init_without_session()
salome.salome_init(1)
+if QApplication.instance() is None:
+ app = QApplication([])
-data_dir = os.path.join(os.path.dirname(sys.argv[0]), "data")
+data_dir = os.path.join(os.path.dirname(inspect.getfile(lambda: None)), "data")
model.begin()
partSet = model.moduleDocument()
assert(abs(dx-400) <= tol)
assert(abs(dy-258.5) <= tol)
assert(abs(dz-0) <= tol)
+assert(ImportImage_1.result().resultSubShapePair()[0].hasTexture())
+assert(Translation_1.result().resultSubShapePair()[0].hasTexture())
+assert(Scale_1.result().resultSubShapePair()[0].hasTexture())
#=============================================================================
# Change the image :
assert(abs(dx-448) <= tol)
assert(abs(dy-296.8) <= tol)
assert(abs(dz-0) <= tol)
+assert(ImportImage_1.result().resultSubShapePair()[0].hasTexture())
+assert(Translation_1.result().resultSubShapePair()[0].hasTexture())
+assert(Scale_1.result().resultSubShapePair()[0].hasTexture())
+assert(model.checkPythonDump())
# Close SALOME GUI
import salome_utils
-import subprocess
-port = salome_utils.getPortNumber()
-proc = subprocess.Popen(["killSalomeWithPort.py", "{}".format(port)])
+import killSalomeWithPort
+
+port = salome_utils.getPortNumber(False)
+if port:
+ killSalomeWithPort.killMyPort(port)