Minor test improvement

This commit is contained in:
Roger Maitland 2023-03-11 18:50:39 -05:00
parent 9ab87d552e
commit 99bb3a52a2
2 changed files with 17 additions and 0 deletions

View file

@ -518,6 +518,17 @@ class TestLocations(unittest.TestCase):
self.assertTupleAlmostEquals(ort[10], (-0.00, 0.00, -120.00), 2)
self.assertTupleAlmostEquals(ort[11], (-0.00, 0.00, -120.00), 2)
def test_from_face(self):
square = Face.make_rect(1, 1, Plane.XZ)
with BuildPart():
loc = Locations(square).locations[0]
self.assertTupleAlmostEquals(
loc.position.to_tuple(), Location(Plane.XZ).position.to_tuple(), 5
)
self.assertTupleAlmostEquals(
loc.orientation.to_tuple(), Location(Plane.XZ).orientation.to_tuple(), 5
)
class TestVectorExtensions(unittest.TestCase):
def test_vector_localization(self):

View file

@ -126,6 +126,12 @@ class TestBuildOnPlanes(unittest.TestCase):
with BuildSketch() as error:
Add(Face.make_rect(1, 1, Plane.XZ))
def test_changing_geometry(self):
with BuildSketch() as s:
Rectangle(1, 2)
Scale(by=(2, 1, 0))
self.assertAlmostEqual(s.sketch.area, 4, 5)
class TestBuildSketchExceptions(unittest.TestCase):
"""Test exception handling"""