Пример #1
0
def test_reverse_none():
    assert shapely.reverse(None) is None
    assert shapely.reverse([None]).tolist() == [None]

    geometry = shapely.Geometry("POLYGON ((0 0, 1 0, 1 1, 0 1, 0 0))")
    expected = shapely.Geometry("POLYGON ((0 0,  0 1, 1 1, 1 0, 0 0))")
    result = shapely.reverse([None, geometry])
    assert result[0] is None
    assert_geometries_equal(result[1], expected)
Пример #2
0
def test_reverse_invalid_type(geom):
    with pytest.raises(TypeError, match="One of the arguments is of incorrect type"):
        shapely.reverse(geom)
Пример #3
0
def test_reverse(geom, expected):
    assert_geometries_equal(shapely.reverse(geom), expected)