From 22782dedaab84bfa1d71a4773716afc95c22922e Mon Sep 17 00:00:00 2001 From: Benjamin Webb <40066515+webb-ben@users.noreply.github.com> Date: Sat, 6 Jul 2024 21:58:09 -0400 Subject: [PATCH] Update Python version for unit test Update test_sensorthings.py Fix ref --- .github/workflows/main.yml | 3 +-- test_sensorthings.py | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0ddd906..7126b4e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/test_sensorthings.py b/test_sensorthings.py index 54c23d5..e2268a7 100644 --- a/test_sensorthings.py +++ b/test_sensorthings.py @@ -2,7 +2,7 @@ # # Authors: Benjamin Webb # -# 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 @@ -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 @@ -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 @@ -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)