From a41f9dedfd626c0adfa2487ac462039996e19cef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20B=C3=A4hr?= Date: Thu, 7 Nov 2024 22:31:32 +0100 Subject: [PATCH] CAM: Fix and enable TestPathHelix again Since the fixture in use has holes smaller than the default tool dimeter, executing a helix operation with default parameters (i.e. all holes) used to fail with an exception. Some tests work around this by actively chaning the tool diameter, and this fix is now moved into the global setup where the respective fixture is loaded. The reason why the tests got disabled in the first place is unclear. --- src/Mod/CAM/CAMTests/TestPathHelix.py | 5 +++-- src/Mod/CAM/TestCAMApp.py | 5 ++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Mod/CAM/CAMTests/TestPathHelix.py b/src/Mod/CAM/CAMTests/TestPathHelix.py index 772f1ab231..5efc50aca2 100644 --- a/src/Mod/CAM/CAMTests/TestPathHelix.py +++ b/src/Mod/CAM/CAMTests/TestPathHelix.py @@ -43,6 +43,9 @@ class TestPathHelix(PathTestUtils.PathTestBase): self.doc = FreeCAD.open(FreeCAD.getHomePath() + "Mod/CAM/CAMTests/test_holes00.fcstd") self.job = PathJob.Create("Job", [self.doc.Body]) + # the smallest hole in the fixture is 1mm in diameter, so our tool must be smaller. + self.job.Tools.Group[0].Tool.Diameter = 0.9 + def tearDown(self): FreeCAD.closeDocument(self.doc.Name) @@ -66,8 +69,6 @@ class TestPathHelix(PathTestUtils.PathTestBase): def test02(self): """Verify Helix generates proper holes for rotated model""" - self.job.Tools.Group[0].Tool.Diameter = 0.5 - op = PathHelix.Create("Helix") proxy = op.Proxy model = self.job.Model.Group[0] diff --git a/src/Mod/CAM/TestCAMApp.py b/src/Mod/CAM/TestCAMApp.py index 2d6e6ae860..ee129b4d8a 100644 --- a/src/Mod/CAM/TestCAMApp.py +++ b/src/Mod/CAM/TestCAMApp.py @@ -37,9 +37,8 @@ from CAMTests.TestPathGeneratorDogboneII import TestGeneratorDogboneII from CAMTests.TestPathGeom import TestPathGeom from CAMTests.TestPathLanguage import TestPathLanguage from CAMTests.TestPathOpDeburr import TestPathOpDeburr - -# from CAMTests.TestPathHelix import TestPathHelix from CAMTests.TestPathHelpers import TestPathHelpers +from CAMTests.TestPathHelix import TestPathHelix from CAMTests.TestPathHelixGenerator import TestPathHelixGenerator from CAMTests.TestPathLog import TestPathLog from CAMTests.TestPathOpUtil import TestPathOpUtil @@ -98,7 +97,7 @@ False if TestPathOpDeburr.__name__ else True False if TestPathDrillable.__name__ else True False if TestPathGeom.__name__ else True False if TestPathHelpers.__name__ else True -# False if TestPathHelix.__name__ else True +False if TestPathHelix.__name__ else True False if TestPathLog.__name__ else True False if TestPathOpUtil.__name__ else True # False if TestPathPost.__name__ else True