Tests: Make PD and Sketcher tests independent of user settings

The Refine property must be explicitly set as otherwise some tests will break because of different user settings
This commit is contained in:
wmayer
2024-07-01 21:08:47 +02:00
committed by Chris Hennes
parent b7c6ffe785
commit fadb607054
3 changed files with 6 additions and 0 deletions

View File

@@ -279,6 +279,7 @@ class TopoShapeTest(unittest.TestCase, TopoShapeAssertions):
def testPartFuse(self):
# Arrange
self.doc.addObject("Part::Fuse", "Fuse")
self.doc.Fuse.Refine = False
self.doc.Fuse.Base = self.doc.Box1
self.doc.Fuse.Tool = self.doc.Box2
# Act

View File

@@ -1353,6 +1353,7 @@ class TestTopologicalNamingProblem(unittest.TestCase):
self.Doc.recompute()
volume1 = body.Shape.Volume
fillet = self.Doc.addObject('PartDesign::Fillet', 'Fillet')
fillet.Refine = True
fillet.Base = (box, ['Edge1',
'Edge5',
'Edge7',
@@ -1398,6 +1399,7 @@ class TestTopologicalNamingProblem(unittest.TestCase):
body.addObject(doc.Sketch)
pocket = self.Doc.addObject('PartDesign::Pocket', 'Pocket')
pocket.Refine = True
pocket.Type = "Length"
pocket.Length = 3
pocket.Direction = App.Vector(-0.710000000,0.7100000000, 0.0000000000)
@@ -1477,6 +1479,7 @@ class TestTopologicalNamingProblem(unittest.TestCase):
doc.addObject("Part::Box","Box")
doc.ActiveObject.Label = "Cube"
doc.addObject("Part::MultiFuse","Fusion")
doc.Fusion.Refine = False
doc.Fusion.Shapes = [doc.Box, doc.Box001,]
doc.recompute()
self.assertEqual(doc.Fusion.Shape.ElementMapSize, 26)
@@ -1517,6 +1520,7 @@ class TestTopologicalNamingProblem(unittest.TestCase):
doc.recompute()
doc.addObject("Part::MultiFuse","Fusion")
doc.Fusion.Refine = False
doc.Fusion.Shapes = [doc.Box, doc.Box001,]
doc.recompute()

View File

@@ -493,6 +493,7 @@ class TestSketcherSolver(unittest.TestCase):
body.addObject(sketch1)
self.Doc.recompute()
hole = self.Doc.addObject("PartDesign::Hole", "Hole")
hole.Refine = True
body.addObject(hole)
hole.Profile = sketch1
hole.Diameter = 0.250000