]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #24412: TestImportImage_1.py TestImportImage_2.py failing
authorazv <azv@opencascade.com>
Fri, 1 Oct 2021 11:12:11 +0000 (14:12 +0300)
committerazv <azv@opencascade.com>
Fri, 1 Oct 2021 11:12:11 +0000 (14:12 +0300)
Use another approach to get the full path for the test case.

src/ExchangePlugin/Test/TestImportImage_1.py
src/ExchangePlugin/Test/TestImportImage_2.py

index 2c974d6bf62b120f40eceafef99e78f590806537..12c575ef59312fa398207186e8c2435e99b4fb32 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-import os
+import os, inspect
 from salome.shaper import model
 
 import salome
 salome.salome_init(1)
 
-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()
index 025bd9267f8a3397dbb129963690dcec1befbfa8..29d72c33cf37fc90a042211ed7bbaf0f7894d297 100755 (executable)
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
-import os
+import os, inspect
 from salome.shaper import model
 
 import salome
 salome.salome_init(1)
 
-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")
 
 from tempfile import TemporaryDirectory
 tmp_dir = TemporaryDirectory()