change osm to arcgis
This commit is contained in:
@@ -99,6 +99,14 @@ def mocked_myqueue(*args, **kwargs): # pragma: no cover
|
||||
def mock_c2open(*args, **kwargs): # pragma: no cover
|
||||
return('aap')
|
||||
|
||||
def mock_osm(*args, **kwargs):
|
||||
return {
|
||||
'ok': True,
|
||||
json: {
|
||||
'country': 'Atlantis',
|
||||
}
|
||||
}
|
||||
|
||||
def mocked_session(*args, **kwargs):
|
||||
|
||||
class MockEngine:
|
||||
@@ -853,6 +861,41 @@ def mocked_requests(*args, **kwargs):
|
||||
}
|
||||
}
|
||||
|
||||
osm_json = [
|
||||
{
|
||||
"place_id": 165922574,
|
||||
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
|
||||
"osm_type": "node",
|
||||
"osm_id": 2756013867,
|
||||
"lat": "52.2229364",
|
||||
"lon": "6.846701",
|
||||
"category": "place",
|
||||
"type": "house",
|
||||
"place_rank": 30,
|
||||
"importance": 0.000009999999999954,
|
||||
"addresstype": "place",
|
||||
"name": "",
|
||||
"display_name": "254, Ir. Schiffstraat, Havengebied, Enschede, Overijssel, Netherlands, 7547 RD, Netherlands",
|
||||
"address": {
|
||||
"house_number": "254",
|
||||
"road": "Ir. Schiffstraat",
|
||||
"industrial": "Havengebied",
|
||||
"city": "Enschede",
|
||||
"state": "Overijssel",
|
||||
"ISO3166-2-lvl4": "NL-OV",
|
||||
"country": "Netherlands",
|
||||
"postcode": "7547 RD",
|
||||
"country_code": "nl"
|
||||
},
|
||||
"boundingbox": [
|
||||
"52.2228864",
|
||||
"52.2229864",
|
||||
"6.8466510",
|
||||
"6.8467510"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
with open('rowers/tests/testdata/stravaworkoutlist.txt') as f:
|
||||
stravaworkoutlist = json.load(f)
|
||||
|
||||
@@ -1061,7 +1104,7 @@ def mocked_requests(*args, **kwargs):
|
||||
if 'rojabo' in args[0]:
|
||||
return MockResponse(rojabodata, 200)
|
||||
|
||||
|
||||
osmtester = re.compile(r'.*?nominatim.openstreetmap.org')
|
||||
polartester = re.compile(r'.*?polaraccesslink\.com')
|
||||
polarremotetester = re.compile(r'.*?polarremote\.com')
|
||||
c2tester = re.compile(r'.*?log\.concept2\.com')
|
||||
@@ -1167,6 +1210,12 @@ def mocked_requests(*args, **kwargs):
|
||||
garmintrainingscheduleregex = r'.*?garmin\.com\/training-api\/schedule'
|
||||
garmintrainingscheduletester = re.compile(garmintrainingscheduleregex)
|
||||
|
||||
if osmtester.match(args[0]):
|
||||
return MockResponse(osm_json, 200)
|
||||
|
||||
if args[0] == '1.1.1.1':
|
||||
return MockResponse(osm_json, 200)
|
||||
|
||||
if garmintester.match(args[0]):
|
||||
if garmindownloadtester.match(args[0]): # pragma: no cover
|
||||
return MockStreamResponse('rowers/tests/testdata/3x250m.fit',200)
|
||||
|
||||
Reference in New Issue
Block a user