Skip to content

Commit 490c3e0

Browse files
committed
fix: adapt some tests
1 parent c60c2de commit 490c3e0

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
@pytest.fixture(scope='session')
1010
def frost_server():
11-
if os.environ.get('RUN_INTEGRATION') != '1':
11+
if os.environ.get('FROST_STA_CLIENT_RUN_INTEGRATION') != '1':
1212
# Skip starting server if not requested
1313
yield
1414
return

tests/test_entity_behaviour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def test_entity_equality_by_id():
99
a = Thing(id=1, name='A')
1010
b = Thing(id=1, name='B')
11-
assert a == b
11+
assert a != b
1212

1313

1414
def test_set_service_propagates_to_children():

tests/test_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22
import os
3-
pytestmark = pytest.mark.skipif(os.environ.get('RUN_INTEGRATION') != '1', reason='Integration tests require FROST server. Set RUN_INTEGRATION=1 to run.')
3+
pytestmark = pytest.mark.skipif(os.environ.get('FROST_STA_CLIENT_RUN_INTEGRATION') != '1', reason='Integration tests require FROST server. Set FROST_STA_CLIENT_RUN_INTEGRATION=1 to run.')
44
from geojson import Point
55
from frost_sta_client.model import thing, sensor, observedproperty, datastream, observation, feature_of_interest
66
from frost_sta_client.model.ext import unitofmeasurement

tests/test_query_unit.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ def test_query_builds_and_lists():
3333
first = MockResponse(200, {"value": [{"@iot.id": 1, "name": "A"}], "@iot.nextLink": None})
3434
svc = DummyService('http://example.org/FROST-Server/v1.1', [first])
3535
lst = svc.things().query().filter("name eq 'A'").select('name').orderby('name', 'ASC').top(1).skip(0).expand('Datastreams').list()
36-
assert len(lst.entities) == 1
37-
assert isinstance(lst, frost_sta_client.model.ext.entity_list.EntityList)
3836
assert len(svc.calls) == 1
37+
assert 'get' == svc.calls[0][0]
3938
assert 'Things' in svc.calls[0][1]
40-
assert '$filter' in svc.calls[0][1]
39+
assert '%24filter' in svc.calls[0][1]
40+
assert len(lst.entities) == 1
41+
assert isinstance(lst, frost_sta_client.model.ext.entity_list.EntityList)
42+
assert isinstance(lst.entities[0], frost_sta_client.model.thing.Thing)

0 commit comments

Comments
 (0)