-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
60 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
*~ | ||
*.swp | ||
.DS_Store | ||
*.pyc | ||
build | ||
dist | ||
overpass.egg-info | ||
|
||
/build/ | ||
/dist/ | ||
/*.egg-info |
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
import geojson | ||
import overpass | ||
|
||
|
||
class TestAPI: | ||
|
||
def test_initialize_api(self): | ||
api = overpass.API() | ||
assert isinstance(api, overpass.API) | ||
assert api.debug == False | ||
assert api.debug == False | ||
|
||
def test_geojson(self): | ||
api = overpass.API() | ||
#osm_elements = api.Get(overpass.MapQuery(37.86517,-122.31851,37.86687,-122.31635)) | ||
#print 'DEB osm_elements:', geojson.dumps(osm_elements,sort_keys=True,indent=2) | ||
osm_geo = api.Get(overpass.MapQuery(37.86517,-122.31851,37.86687,-122.31635), asGeoJSON=True) | ||
#with open('test.geojson','w') as f: | ||
# geojson.dump(osm_geo,f,indent=2,sort_keys=True) | ||
assert len(osm_geo['features'])>1 | ||
|
||
def run_tests(self): | ||
self.test_initialize_api() | ||
self.test_geojson() | ||
|
||
if __name__ == '__main__': | ||
tapi = TestAPI() | ||
tapi.run_tests() | ||
print "overpass PASS" |