From c75e8d3123c26cd721b49d527c60eef60537df89 Mon Sep 17 00:00:00 2001 From: jdegenstein Date: Mon, 11 Dec 2023 11:24:40 -0600 Subject: [PATCH] Update test_build_sketch.py -> Trapezoid tests add coverage for Trapezoid changes --- tests/test_build_sketch.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_build_sketch.py b/tests/test_build_sketch.py index dcf487b0..8b287be3 100644 --- a/tests/test_build_sketch.py +++ b/tests/test_build_sketch.py @@ -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)