mirror of
https://github.com/gumyr/build123d.git
synced 2025-12-06 02:30:55 -08:00
Update test_build_sketch.py -> Trapezoid tests
add coverage for Trapezoid changes
This commit is contained in:
parent
767bf03578
commit
c75e8d3123
1 changed files with 12 additions and 0 deletions
|
|
@ -382,6 +382,18 @@ class TestBuildSketchObjects(unittest.TestCase):
|
|||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue