mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-15 15:20:37 -08:00
Minor test improvement
This commit is contained in:
parent
9ab87d552e
commit
99bb3a52a2
2 changed files with 17 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue