def test_squares_equals_area_after_add_area(): square_1 = Square(4, 2) triangle_2 = Triangle(6, 2) assert square_1.add_area(triangle_2) == triangle_2.add_area(square_1)
def test_error_if_not_figure(): triangle = Triangle(4, 2) with pytest.raises(Exception): triangle.add_area(object())
def test_rectangles_equals_area_after_add_area(): rectangle_1 = Rectangle(5, 2) triangle_2 = Triangle(6, 3) assert rectangle_1.add_area(triangle_2) == triangle_2.add_area(rectangle_1)
def test_triangles_equals_area_after_add_area(): triangle_1 = Triangle(4, 2) triangle_2 = Triangle(6, 2) assert triangle_1.add_area(triangle_2) == triangle_2.add_area(triangle_1)