-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve google reverse geocoding parse results
- Loading branch information
Showing
5 changed files
with
143 additions
and
102 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from unittest import mock | ||
|
||
import pytest | ||
import requests | ||
|
||
from winds_mobi_provider import Provider | ||
|
||
|
||
@pytest.mark.skip("Need a redis connection to Google API caches") | ||
@pytest.mark.parametrize( | ||
"station_id,expected_name", | ||
[("metar-LSMP", "Payerne"), ("metar-LSGC", "Aero Group S.A."), ("metar-LSGG", "Geneva Airport")], | ||
) | ||
@mock.patch("winds_mobi_provider.provider.MongoClient") | ||
def test_parse_reverse_geocoding_results(mongodb, station_id, expected_name): | ||
lon, lat = requests.get(f"https://winds.mobi/api/2.3/stations/{station_id}").json()["loc"]["coordinates"] | ||
provider = Provider() | ||
short_name, name = provider._Provider__parse_reverse_geocoding_results(f"address2/{lat},{lon}", None, None, None) | ||
assert short_name == expected_name | ||
assert name == expected_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters