-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #254 from DenisCarriere/fix_tests_with_mocks
added mocks for test_geonames
- Loading branch information
Showing
14 changed files
with
775 additions
and
42 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -327,5 +327,5 @@ def place_rank(self): | |
|
||
|
||
if __name__ == '__main__': | ||
g = Osm("Ottawa, ON") | ||
g = Osm('Ottawa, Ontario') | ||
g.debug() |
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 |
---|---|---|
|
@@ -12,3 +12,4 @@ ratelim==0.1.6 | |
requests==2.18.1 | ||
six==1.10.0 | ||
urllib3==1.21.1 | ||
requests-mock==1.3.0 |
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 @@ | ||
{ | ||
"totalResultsCount": 142, | ||
"geonames": [{ | ||
"adminCode1": "08", | ||
"lng": "-75.69812", | ||
"geonameId": 6094817, | ||
"toponymName": "Ottawa", | ||
"countryId": "6251999", | ||
"fcl": "P", | ||
"population": 812129, | ||
"countryCode": "CA", | ||
"name": "Ottawa", | ||
"fclName": "city, village,...", | ||
"countryName": "Canada", | ||
"fcodeName": "capital of a political entity", | ||
"adminName1": "Ontario", | ||
"lat": "45.41117", | ||
"fcode": "PPLC" | ||
}] | ||
} |
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,39 @@ | ||
{ | ||
"totalResultsCount": 2, | ||
"geonames": [ | ||
{ | ||
"adminCode1": "10", | ||
"lng": "-75.76583", | ||
"geonameId": 5901584, | ||
"toponymName": "Birch Manor", | ||
"countryId": "6251999", | ||
"fcl": "P", | ||
"population": 0, | ||
"countryCode": "CA", | ||
"name": "Birch Manor", | ||
"fclName": "city, village,...", | ||
"countryName": "Canada", | ||
"fcodeName": "section of populated place", | ||
"adminName1": "Quebec", | ||
"lat": "45.42472", | ||
"fcode": "PPLX" | ||
}, | ||
{ | ||
"adminCode1": "10", | ||
"lng": "-75.58833", | ||
"geonameId": 6162703, | ||
"toponymName": "Templeton-Est", | ||
"countryId": "6251999", | ||
"fcl": "P", | ||
"population": 0, | ||
"countryCode": "CA", | ||
"name": "Templeton-Est", | ||
"fclName": "city, village,...", | ||
"countryName": "Canada", | ||
"fcodeName": "section of populated place", | ||
"adminName1": "Quebec", | ||
"lat": "45.49389", | ||
"fcode": "PPLX" | ||
} | ||
] | ||
} |
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,81 @@ | ||
{ | ||
"geonames": [ | ||
{ | ||
"lng": "0", | ||
"geonameId": 6295630, | ||
"name": "Earth", | ||
"fclName": "parks,area, ...", | ||
"toponymName": "Earth", | ||
"fcodeName": "area", | ||
"adminName1": "", | ||
"lat": "0", | ||
"fcl": "L", | ||
"fcode": "AREA", | ||
"population": 6814400000 | ||
}, | ||
{ | ||
"lng": "-100.54688", | ||
"geonameId": 6255149, | ||
"name": "North America", | ||
"fclName": "parks,area, ...", | ||
"toponymName": "North America", | ||
"fcodeName": "continent", | ||
"adminName1": "", | ||
"lat": "46.07323", | ||
"fcl": "L", | ||
"fcode": "CONT", | ||
"population": 0 | ||
}, | ||
{ | ||
"adminCode1": "00", | ||
"lng": "-113.64258", | ||
"geonameId": 6251999, | ||
"toponymName": "Canada", | ||
"countryId": "6251999", | ||
"fcl": "A", | ||
"population": 33679000, | ||
"countryCode": "CA", | ||
"name": "Canada", | ||
"fclName": "country, state, region,...", | ||
"countryName": "Canada", | ||
"fcodeName": "independent political entity", | ||
"adminName1": "", | ||
"lat": "60.10867", | ||
"fcode": "PCLI" | ||
}, | ||
{ | ||
"adminCode1": "08", | ||
"lng": "-84.49983", | ||
"geonameId": 6093943, | ||
"toponymName": "Ontario", | ||
"countryId": "6251999", | ||
"fcl": "A", | ||
"population": 12861940, | ||
"countryCode": "CA", | ||
"name": "Ontario", | ||
"fclName": "country, state, region,...", | ||
"countryName": "Canada", | ||
"fcodeName": "first-order administrative division", | ||
"adminName1": "Ontario", | ||
"lat": "49.25014", | ||
"fcode": "ADM1" | ||
}, | ||
{ | ||
"adminCode1": "08", | ||
"lng": "-75.69812", | ||
"geonameId": 6094817, | ||
"toponymName": "Ottawa", | ||
"countryId": "6251999", | ||
"fcl": "P", | ||
"population": 812129, | ||
"countryCode": "CA", | ||
"name": "Ottawa", | ||
"fclName": "city, village,...", | ||
"countryName": "Canada", | ||
"fcodeName": "capital of a political entity", | ||
"adminName1": "Ontario", | ||
"lat": "45.41117", | ||
"fcode": "PPLC" | ||
} | ||
] | ||
} |
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,74 @@ | ||
{ | ||
"results": [ | ||
{ | ||
"address_components": [ | ||
{ | ||
"long_name": "Ottawa", | ||
"short_name": "Ottawa", | ||
"types": [ | ||
"locality", | ||
"political" | ||
] | ||
}, | ||
{ | ||
"long_name": "Ottawa Division", | ||
"short_name": "Ottawa Division", | ||
"types": [ | ||
"administrative_area_level_2", | ||
"political" | ||
] | ||
}, | ||
{ | ||
"long_name": "Ontario", | ||
"short_name": "ON", | ||
"types": [ | ||
"administrative_area_level_1", | ||
"political" | ||
] | ||
}, | ||
{ | ||
"long_name": "Canada", | ||
"short_name": "CA", | ||
"types": [ | ||
"country", | ||
"political" | ||
] | ||
} | ||
], | ||
"formatted_address": "Ottawa, ON, Canada", | ||
"geometry": { | ||
"bounds": { | ||
"northeast": { | ||
"lat": 45.5375801, | ||
"lng": -75.2465979 | ||
}, | ||
"southwest": { | ||
"lat": 44.962733, | ||
"lng": -76.3539158 | ||
} | ||
}, | ||
"location": { | ||
"lat": 45.4215296, | ||
"lng": -75.69719309999999 | ||
}, | ||
"location_type": "APPROXIMATE", | ||
"viewport": { | ||
"northeast": { | ||
"lat": 45.5375801, | ||
"lng": -75.2465979 | ||
}, | ||
"southwest": { | ||
"lat": 44.962733, | ||
"lng": -76.3539158 | ||
} | ||
} | ||
}, | ||
"place_id": "ChIJrxNRX7IFzkwR7RXdMeFRaoo", | ||
"types": [ | ||
"locality", | ||
"political" | ||
] | ||
} | ||
], | ||
"status": "OK" | ||
} |
Oops, something went wrong.