Answered step by step
Verified Expert Solution
Question
1 Approved Answer
class code: test code: 1. You must declare Test_Trapezoid class that inherits unittest. TestCase. 2. You must define a instance method named test_area in the
class code:
test code:
1. You must declare Test_Trapezoid class that inherits unittest. TestCase. 2. You must define a instance method named test_area in the file test_trapezoid.py which asserts two test cases: - Test One Given a trapezoid with these values Base_a: 10, Base_b: 5 , Height: 4 has an area of 30.00. - Test Two Given a trapezoid with these values Base_a: 25.34, Base_b: 7.12, Height: 0.5 has an area of 8.12. class Trapezoid: \[ \begin{array}{l}\text { def } \quad \text { init__(self, base_a, base_b, height): } \\ \text { self.base_a = base_a } \\ \text { self.base_b = base_b } \\ \text { self.height = height }\end{array} \] def area(self): result = round(((self.base_a + self.base_b) /2) self.height, 2) return result import unittest \# test the class from test_trapezoid import Test_Trapezoid result = unittest.main() print(result)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started