Skip to content

Commit

Permalink
Update Python version for unit test
Browse files Browse the repository at this point in the history
Update test_sensorthings.py

Fix ref
  • Loading branch information
webb-ben committed Jul 7, 2024
1 parent 4804db7 commit 22782de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ jobs:
strategy:
matrix:
include:
- python-version: 3.6
- python-version: 3.7
- python-version: '3.10'

steps:
- uses: actions/checkout@v2
Expand Down
10 changes: 5 additions & 5 deletions test_sensorthings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Authors: Benjamin Webb <[email protected]>
#
# Copyright (c) 2022 Benjamin Webb
# Copyright (c) 2024 Benjamin Webb
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
Expand Down Expand Up @@ -48,14 +48,13 @@ def config():
def test_query_datastreams(config):
p = SensorThingsProvider(config)
fields = p.get_fields()
assert len(fields) == 15
assert len(fields) == 16
assert fields['Thing']['type'] == 'number'
assert fields['Observations']['type'] == 'number'
assert fields['@iot.id']['type'] == 'number'
assert fields['name']['type'] == 'string'

kwargs = {'sortby': [{'property': '@iot.id', 'order': '+'}]}
results = p.query(**kwargs)
results = p.query()
assert len(results['features']) == 10
assert results['numberReturned'] == 10
assert len(results['features'][0]['properties']['Observations']) == 17
Expand All @@ -71,7 +70,7 @@ def test_query_datastreams(config):
assert len(results['features']) == 1
assert results['features'][0]['id'] == '3'

assert len(results['features'][0]['properties']) == 17
assert len(results['features'][0]['properties']) == 18

results = p.query(bbox=[-109, 36, -106, 37])
assert results['numberReturned'] == 8
Expand All @@ -89,6 +88,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)

Expand Down

0 comments on commit 22782de

Please sign in to comment.