Some tests to figure out Travis failures

This commit is contained in:
Markus Lampert
2018-07-04 10:33:57 -07:00
parent c4426c28e6
commit d2efdc4080

View File

@@ -74,6 +74,11 @@ def makeWire(pts):
return Part.Wire(edges)
pa = Vector(1, 1, 0)
pb = Vector(1, 5, 0)
pc = Vector(5, 5, 0)
pd = Vector(5, 1, 0)
class TestPathOpTools(PathTestUtils.PathTestBase):
@classmethod
@@ -86,21 +91,27 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
FreeCAD.closeDocument("test_geomop")
def test00(self):
'''Check that face orientation has anything to do with the wire orientation.'''
pa = Vector(1, 1, 0)
pb = Vector(1, 5, 0)
pc = Vector(5, 5, 0)
pd = Vector(5, 1, 0)
w = makeWire([pa, pb, pc, pd])
f = Part.Face(w)
self.assertCoincide(Vector(0, 0, -1), f.Surface.Axis)
def test01(self):
w = makeWire([pa, pb, pc, pd])
f = Part.Face(w)
self.assertEqual('Forward', f.Orientation)
def test10(self):
w = makeWire([pa, pd, pc, pb])
f = Part.Face(w)
self.assertCoincide(Vector(0, 0, +1), f.Surface.Axis)
def test01(self):
def test11(self):
w = makeWire([pa, pb, pc, pd])
f = Part.Face(w)
self.assertEqual('Forward', f.Orientation)
def xtest01(self):
'''Check offsetting a circular hole.'''
obj = doc.getObjectsByLabel('offset-circle')[0]
@@ -119,7 +130,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertRoughly(0.1, wire.Edges[0].Curve.Radius)
self.assertCoincide(Vector(0, 0, 1), wire.Edges[0].Curve.Axis)
def test02(self):
def xtest02(self):
'''Check offsetting a circular hole by the radius or more makes the hole vanish.'''
obj = doc.getObjectsByLabel('offset-circle')[0]
@@ -131,7 +142,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
wire = PathOpTools.offsetWire(small, obj.Shape, 15, True)
self.assertIsNone(wire)
def test03(self):
def xtest03(self):
'''Check offsetting a cylinder succeeds.'''
obj = doc.getObjectsByLabel('offset-circle')[0]
@@ -150,7 +161,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertRoughly(40, wire.Edges[0].Curve.Radius)
self.assertCoincide(Vector(0, 0, -1), wire.Edges[0].Curve.Axis)
def test04(self):
def xtest04(self):
'''Check offsetting a hole with Placement.'''
obj = doc.getObjectsByLabel('offset-placement')[0]
@@ -169,7 +180,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(0, 0, 0), wire.Edges[0].Curve.Center)
self.assertCoincide(Vector(0, 0, 1), wire.Edges[0].Curve.Axis)
def test05(self):
def xtest05(self):
'''Check offsetting a cylinder with Placement.'''
obj = doc.getObjectsByLabel('offset-placement')[0]
@@ -188,7 +199,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(0, 0, 0), wire.Edges[0].Curve.Center)
self.assertCoincide(Vector(0, 0, -1), wire.Edges[0].Curve.Axis)
def test10(self):
def xtest10(self):
'''Check offsetting hole wire succeeds.'''
obj = doc.getObjectsByLabel('offset-edge')[0]
@@ -208,7 +219,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
f = Part.Face(wire)
self.assertCoincide(Vector(0, 0, -1), f.Surface.Axis)
def test11(self):
def xtest11(self):
'''Check offsetting hole wire for more than it's size makes hole vanish.'''
obj = doc.getObjectsByLabel('offset-edge')[0]
@@ -220,7 +231,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
wire = PathOpTools.offsetWire(small, obj.Shape, 5, True)
self.assertIsNone(wire)
def test12(self):
def xtest12(self):
'''Check offsetting a body wire succeeds.'''
obj = doc.getObjectsByLabel('offset-edge')[0]
@@ -260,7 +271,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
f = Part.Face(wire)
self.assertCoincide(Vector(0, 0, -1), f.Surface.Axis)
def test21(self):
def xtest21(self):
'''Check offsetting a cylinder.'''
obj = doc.getObjectsByLabel('circle-cut')[0]
@@ -280,7 +291,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertRoughly(33, edge.Curve.Radius)
def test22(self):
def xtest22(self):
'''Check offsetting a box.'''
obj = doc.getObjectsByLabel('square-cut')[0]
@@ -314,7 +325,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(0, 0, +1), e.Curve.Axis)
def test23(self):
def xtest23(self):
'''Check offsetting a triangle.'''
obj = doc.getObjectsByLabel('triangle-cut')[0]
@@ -342,7 +353,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertRoughly(3, e.Curve.Radius)
self.assertCoincide(Vector(0, 0, +1), e.Curve.Axis)
def test24(self):
def xtest24(self):
'''Check offsetting a shape.'''
obj = doc.getObjectsByLabel('shape-cut')[0]
@@ -371,7 +382,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertRoughly(radius, e.Curve.Radius)
self.assertCoincide(Vector(0, 0, +1), e.Curve.Axis)
def test25(self):
def xtest25(self):
'''Check offsetting a cylindrical hole.'''
obj = doc.getObjectsByLabel('circle-cut')[0]
@@ -391,7 +402,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertRoughly(27, edge.Curve.Radius)
def test26(self):
def xtest26(self):
'''Check offsetting a square hole.'''
obj = doc.getObjectsByLabel('square-cut')[0]
@@ -415,7 +426,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertRoughly(54, e.Length)
def test27(self):
def xtest27(self):
'''Check offsetting a triangular holee.'''
obj = doc.getObjectsByLabel('triangle-cut')[0]
@@ -437,7 +448,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
f = Part.Face(wire)
self.assertCoincide(Vector(0, 0, +1), f.Surface.Axis)
def test28(self):
def xtest28(self):
'''Check offsetting a shape hole.'''
obj = doc.getObjectsByLabel('shape-cut')[0]
@@ -467,7 +478,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(0, 0, +1), e.Curve.Axis)
def test30(self):
def xtest30(self):
'''Check offsetting a single outside edge forward.'''
obj = doc.getObjectsByLabel('offset-edge')[0]
@@ -502,7 +513,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(+x, y, 0), wire.Edges[0].Vertexes[0].Point)
self.assertCoincide(Vector(-x, y, 0), wire.Edges[0].Vertexes[1].Point)
def test31(self):
def xtest31(self):
'''Check offsetting a single outside edge not forward.'''
obj = doc.getObjectsByLabel('offset-edge')[0]
@@ -536,7 +547,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(-x, y, 0), wire.Edges[0].Vertexes[0].Point)
self.assertCoincide(Vector(+x, y, 0), wire.Edges[0].Vertexes[1].Point)
def test32(self):
def xtest32(self):
'''Check offsetting multiple outside edges.'''
obj = doc.getObjectsByLabel('offset-edge')[0]
@@ -573,7 +584,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(0, 20, 0), rEdges[0].Curve.Center)
self.assertCoincide(Vector(0, 0, +1), rEdges[0].Curve.Axis)
def test33(self):
def xtest33(self):
'''Check offsetting multiple backwards outside edges.'''
# This is exactly the same as test32, except that the wire is flipped to make
# sure the input orientation doesn't matter
@@ -613,7 +624,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(0, 20, 0), rEdges[0].Curve.Center)
self.assertCoincide(Vector(0, 0, +1), rEdges[0].Curve.Axis)
def test34(self):
def xtest34(self):
'''Check offsetting a single inside edge forward.'''
obj = doc.getObjectsByLabel('offset-edge')[0]
@@ -648,7 +659,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(-x, y, 0), wire.Edges[0].Vertexes[0].Point)
self.assertCoincide(Vector(+x, y, 0), wire.Edges[0].Vertexes[1].Point)
def test35(self):
def xtest35(self):
'''Check offsetting a single inside edge not forward.'''
obj = doc.getObjectsByLabel('offset-edge')[0]
@@ -683,7 +694,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
self.assertCoincide(Vector(+x, y, 0), wire.Edges[0].Vertexes[0].Point)
self.assertCoincide(Vector(-x, y, 0), wire.Edges[0].Vertexes[1].Point)
def test36(self):
def xtest36(self):
'''Check offsetting multiple inside edges.'''
obj = doc.getObjectsByLabel('offset-edge')[0]
@@ -714,7 +725,7 @@ class TestPathOpTools(PathTestUtils.PathTestBase):
rEdges = [e for e in wire.Edges if Part.Circle == type(e.Curve)]
self.assertEqual(0, len(rEdges))
def test37(self):
def xtest37(self):
'''Check offsetting multiple backwards inside edges.'''
# This is exactly the same as test36 except that the wire is flipped to make
# sure it's orientation doesn't matter