Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

class code:

image text in transcribed

test code:

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

python is an interpreter thusthis python can be

Answered: 1 week ago

Question

11. Are your speaking notes helpful and effective?

Answered: 1 week ago

Question

The Goals of Informative Speaking Topics for Informative

Answered: 1 week ago