Allow STA entity to be URL encoded (#1171)

This commit is contained in:
Benjamin Webb
2023-03-14 12:41:32 -04:00
committed by GitHub
parent 2f8fff4c8b
commit 4a18393662
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -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:
+2 -2
View File
@@ -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)