Allow STA entity to be URL encoded (#1171)
This commit is contained in:
@@ -93,7 +93,11 @@ class SensorThingsProvider(BaseProvider):
|
||||
self.entity = provider_def['entity']
|
||||
self._url = url_join(self.data, self.entity)
|
||||
except KeyError:
|
||||
raise RuntimeError('name/type/data are required')
|
||||
if self.data.split('/').pop() in ENTITY:
|
||||
self.entity = self.data.split('/').pop()
|
||||
self._url = self.data
|
||||
else:
|
||||
raise RuntimeError('Entity type required')
|
||||
|
||||
# Default id
|
||||
if self.id_field is None or not self.id_field:
|
||||
|
||||
@@ -37,9 +37,8 @@ def config():
|
||||
return {
|
||||
'name': 'SensorThings',
|
||||
'type': 'feature',
|
||||
'data': 'http://localhost:8888/FROST-Server/v1.1/',
|
||||
'data': 'http://localhost:8888/FROST-Server/v1.1/Datastreams',
|
||||
'rel_link': 'http://localhost:5000',
|
||||
'entity': 'Datastreams',
|
||||
'intralink': True,
|
||||
'time_field': 'phenomenonTime'
|
||||
}
|
||||
@@ -88,6 +87,7 @@ def test_query_datastreams(config):
|
||||
def test_query_observations(config):
|
||||
config['properties'] = ['Datastream', 'phenomenonTime',
|
||||
'FeatureOfInterest', 'result']
|
||||
config['data'] = 'http://localhost:8888/FROST-Server/v1.1/'
|
||||
config['entity'] = 'Observations'
|
||||
p = SensorThingsProvider(config)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user