def test_error_if_not_figure(): rectangle = Rectangle(5, 2) with pytest.raises(Exception): rectangle.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)