Exemplo n.º 1
0
def test_triangle_angle_abc(point1, point2, point3, expected_angle):
    """
    Verify that the angle_abc function returns expected values
    """
    triangle = decide.Triangle(decide.Point(point1), decide.Point(point2),
                               decide.Point(point3))
    assert triangle.angle_abc() == pytest.approx(expected_angle)
Exemplo n.º 2
0
def test_triangle_circumradius(point1, point2, point3, expected_radius):
    """
    Verify that the circumradius function returns expected values
    """
    triangle = decide.Triangle(decide.Point(point1), decide.Point(point2),
                               decide.Point(point3))
    assert triangle.circumradius() == pytest.approx(expected_radius)
Exemplo n.º 3
0
def test_distance(point1, point2, expected_distance):
    """
    Verify that the distance function returns expected values
    """
    assert decide.Point(point1).distance(decide.Point(point2)) == pytest.approx(
        expected_distance
    )
Exemplo n.º 4
0
def test_triangle_area(point1, point2, point3, expected_area, message):
    """
    Verify that the triangle_area function returns expected values
    """
    triangle = decide.Triangle(decide.Point(point1), decide.Point(point2),
                               decide.Point(point3))
    assert triangle.area() == pytest.approx(expected_area), message
Exemplo n.º 5
0
def test_quadrant(coordinates, expected_quadrant):
    """
    Verify that the quadrant function returns expected values
    """
    point = decide.Point(coordinates)
    assert point.quadrant() == expected_quadrant