Пример #1
0
def test_compute_regular_polygon_vertices_input_error_handling(
        n_sides, bounding_circle, rotation, expected_error, error_message):
    with pytest.raises(expected_error) as e:
        ImageDraw._compute_regular_polygon_vertices(bounding_circle, n_sides,
                                                    rotation)
    assert str(e.value) == error_message
Пример #2
0
def test_compute_regular_polygon_vertices(n_sides, expected_vertices):
    bounding_circle = (W // 2, H // 2, 25)
    vertices = ImageDraw._compute_regular_polygon_vertices(
        bounding_circle, n_sides, 0)
    assert vertices == expected_vertices