Fixed build and tests.

This commit is contained in:
Markus Lampert 2016-12-15 15:47:52 -08:00
parent 068dc2d72d
commit f232096eb4

View File

@ -50,27 +50,21 @@ class TestHoldingTags(PathTestBase):
def test01(self): def test01(self):
"""Verify solid and core for a 90 degree tag are identical cylinders.""" """Verify solid for a 90 degree tag is a cylinder."""
tag = Tag(100, 200, 4, 5, 90, True) tag = Tag(100, 200, 4, 5, 90, True)
tag.createSolidsAt(17) tag.createSolidsAt(17)
self.assertIsNotNone(tag.solid) self.assertIsNotNone(tag.solid)
self.assertCylinderAt(tag.solid, Vector(100, 200, 17), 2, 5) self.assertCylinderAt(tag.solid, Vector(100, 200, 17), 2, 5)
self.assertIsNotNone(tag.core)
self.assertCylinderAt(tag.core, Vector(100, 200, 17), 2, 5)
def test02(self): def test02(self):
"""Verify trapezoidal tag has a cone shape with a lid, and cylinder core.""" """Verify trapezoidal tag has a cone shape with a lid."""
tag = Tag(0, 0, 18, 5, 45, True) tag = Tag(0, 0, 18, 5, 45, True)
tag.createSolidsAt(0) tag.createSolidsAt(0)
self.assertIsNotNone(tag.solid) self.assertIsNotNone(tag.solid)
self.assertConeAt(tag.solid, Vector(0,0,0), 9, 4, 5) self.assertConeAt(tag.solid, Vector(0,0,0), 9, 4, 5)
self.assertIsNotNone(tag.core)
self.assertCylinderAt(tag.core, Vector(0,0,0), 4, 5)
def test03(self): def test03(self):
"""Verify pointy cone shape of tag with pointy end if width, angle and height match up.""" """Verify pointy cone shape of tag with pointy end if width, angle and height match up."""
tag = Tag(0, 0, 10, 5, 45, True) tag = Tag(0, 0, 10, 5, 45, True)
@ -78,8 +72,6 @@ class TestHoldingTags(PathTestBase):
self.assertIsNotNone(tag.solid) self.assertIsNotNone(tag.solid)
self.assertConeAt(tag.solid, Vector(0,0,0), 5, 0, 5) self.assertConeAt(tag.solid, Vector(0,0,0), 5, 0, 5)
self.assertIsNone(tag.core)
def test04(self): def test04(self):
"""Verify height adjustment if tag isn't wide eough for angle.""" """Verify height adjustment if tag isn't wide eough for angle."""
tag = Tag(0, 0, 5, 17, 60, True) tag = Tag(0, 0, 5, 17, 60, True)
@ -87,5 +79,3 @@ class TestHoldingTags(PathTestBase):
self.assertIsNotNone(tag.solid) self.assertIsNotNone(tag.solid)
self.assertConeAt(tag.solid, Vector(0,0,0), 2.5, 0, 2.5 * math.tan((60/180.0)*math.pi)) self.assertConeAt(tag.solid, Vector(0,0,0), 2.5, 0, 2.5 * math.tan((60/180.0)*math.pi))
self.assertIsNone(tag.core)