From 62bd69e53d63f7eed2ce681ad79626c56e0b4e00 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Wed, 29 Sep 2021 10:24:11 -0500 Subject: [PATCH] [OpenSCAD] Update STL unit test to warn on pipes If OpenSCAD or FreeCAD is set up to use pipes for communication, assume it's because one or the other is sandboxed. In that case, OpenSCAD will not be able to import the generated STL file from FreeCAD, so don't try to run that test. --- src/Mod/OpenSCAD/OpenSCADTest/app/test_importCSG.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Mod/OpenSCAD/OpenSCADTest/app/test_importCSG.py b/src/Mod/OpenSCAD/OpenSCADTest/app/test_importCSG.py index 0fc8083ac1..59759a7c47 100644 --- a/src/Mod/OpenSCAD/OpenSCADTest/app/test_importCSG.py +++ b/src/Mod/OpenSCAD/OpenSCADTest/app/test_importCSG.py @@ -305,6 +305,13 @@ polyhedron( # FreeCAD.closeDocument(doc.Name) def test_import_import_stl(self): + preferences = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/OpenSCAD") + transfer_mechanism = preferences.GetInt('transfermechanism',0) + if transfer_mechanism == 2: + print ("Cannot test STL import, communication with OpenSCAD is via pipes") + print ("If either OpenSCAD or FreeCAD are installed as sandboxed packages,") + print ("use of import is not possible.") + return testfile = join(self.test_dir, "Cube.stl").replace('\\','/') doc = self.utility_create_scad("import(\"{}\");".format(testfile), "import_stl"); object = doc.ActiveObject