Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gboeing committed Nov 27, 2023
1 parent 4dab6d9 commit a395a2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion osmnx/elevation.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def add_node_elevations_google(
# sanity check that all our vectors have the same number of elements
msg = f"Graph has {len(G):,} nodes and we received {len(results):,} results from {domain!r}"
utils.log(msg)
if not (len(results) == len(G) == len(node_points)):
if not (len(results) == len(G) == len(node_points)): # pragma: no cover
err_msg = f"{msg}\n{response_json}"
raise InsufficientResponseError(err_msg)

Expand Down
8 changes: 7 additions & 1 deletion tests/test_osmnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,13 @@ def test_elevation():

# add node elevations from Google (fails without API key)
with pytest.raises(ox._errors.InsufficientResponseError):
_ = ox.elevation.add_node_elevations_google(G, api_key="")
_ = ox.elevation.add_node_elevations_google(
G,
api_key="",
max_locations_per_batch=350,
precision=2,
url_template=ox.settings.elevation_url_template,
)

# add node elevations from Open Topo Data (works without API key)
ox.settings.elevation_url_template = (
Expand Down

0 comments on commit a395a2f

Please sign in to comment.