Exemplo n.º 1
0
def test_error_if_not_figure():
    rectangle = Square(4, 2)
    with pytest.raises(Exception):
        rectangle.add_area(object())
Exemplo n.º 2
0
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)