Skip to content

Commit

Permalink
Update test_build_sketch.py -> Trapezoid tests
Browse files Browse the repository at this point in the history
add coverage for Trapezoid changes
  • Loading branch information
jdegenstein authored Dec 11, 2023
1 parent 767bf03 commit c75e8d3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_build_sketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,18 @@ def test_trapezoid(self):
with BuildSketch() as test:
Trapezoid(6, 2, 30)

with self.assertRaises(ValueError):
with BuildSketch() as test:
Trapezoid(6, 2, 150)

with BuildSketch() as test:
t = Trapezoid(12,8,135,90)
self.assertEqual(t.width, 12)
self.assertEqual(t.trapezoid_height, 8)
self.assertEqual(t.left_side_angle, 135)
self.assertEqual(t.right_side_angle, 90)
self.assertAlmostEqual(test.sketch.area, 8 * (12 + 4) / 2, 5)

def test_triangle(self):
tri = Triangle(a=3, b=4, c=5)
self.assertAlmostEqual(tri.area, (3 * 4) / 2, 5)
Expand Down

0 comments on commit c75e8d3

Please sign in to comment.