Skip to content

Commit 574270e

Browse files
author
Lukas Müller
committed
Added explanatory comment to test
1 parent e0b2fcf commit 574270e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/test_api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ class API(overpass.API):
3232
def _get_from_overpass(self, query):
3333
return pickle.load(open(os.path.join(os.path.dirname(__file__), "example.response"), "rb"))
3434

35+
# The commented code should only be executed once when major changes to the Overpass API and/or to this wrapper are
36+
# introduced. One than has to manually verify that the date in the example.response file from the Overpass API
37+
# matches the data in the example.json file generated by this wrapper.
38+
#
39+
# The reason for this approach is the following: It is not safe to make calls to the actual API in this test as the
40+
# API might momentarily be unavailable and the underlying data can also change at any moment. The commented code is
41+
# needed to create the example.response and example.json files. The example.response file is subsequently used to
42+
# fake the _get_from_overpass method during the tests and the example.json file is the reference that we are
43+
# asserting against.
44+
#
3545
# api = overpass.API()
3646
# osm_geo = api.get("rel(6518385);out body geom;way(10322303);out body geom;node(4927326183);", verbosity='body geom')
3747
# pickle.dump(api._get_from_overpass("[out:json];rel(6518385);out body geom;way(10322303);out body geom;node(4927326183);out body geom;"),

0 commit comments

Comments
 (0)