示例#1
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)
示例#2
0
def test_error_if_not_figure():
    triangle = Triangle(4, 2)
    with pytest.raises(Exception):
        triangle.add_area(object())
示例#3
0
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)
示例#4
0
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)