def test_geocoder() -> None:
    """Test retrieving elements by place name and OSM ID."""
    city = ox.geocode_to_gdf("R2999176", by_osmid=True)
    city = ox.geocode_to_gdf(place1, which_result=1)
    city_projected = ox.projection.project_gdf(city, to_crs="epsg:3395")

    # test geocoding a bad query: should raise exception
    with pytest.raises(ox._errors.InsufficientResponseError):
        _ = ox.geocode("!@#$%^&*")

    with pytest.raises(ox._errors.InsufficientResponseError):
        _ = ox.geocode_to_gdf(query="AAAZZZ")

    # fails to geocode to a (Multi)Polygon
    with pytest.raises(TypeError):
        _ = ox.geocode_to_gdf("Civic Center, San Francisco, California, USA")
Test retrieving elements by place name and OSM ID.
tests/test_osmnx.py