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 #74 from metaodi/fix-type-error
Raise an exception if the API returned 410
- Loading branch information
Showing
6 changed files
with
54 additions
and
15 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,5 +1,6 @@ | ||
dist/ | ||
MANIFEST | ||
*.pyc | ||
*.egg-info | ||
.coverage | ||
.tox |
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 |
---|---|---|
|
@@ -9,3 +9,4 @@ coveralls==0.4.1 | |
mock==1.0.1 | ||
xmltodict==0.9.0 | ||
virtualenv==15.1.0 | ||
httpretty==0.8.14 |
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,17 @@ | ||
import httpretty | ||
import unittest | ||
import osmapi | ||
|
||
|
||
class TestOsmApiFunctional(unittest.TestCase): | ||
@httpretty.activate | ||
def test_deleted_element_raises_exception(self): | ||
httpretty.register_uri( | ||
httpretty.GET, | ||
"https://www.openstreetmap.org/api/0.6/relation/2911456/full", | ||
status=410 | ||
) | ||
with self.assertRaises(osmapi.ElementDeletedApiError) as context: | ||
api = osmapi.OsmApi() | ||
api.RelationFull(2911456) | ||
self.assertEquals(410, context.exception.status) |
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