Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions tests/test_ogcapi_connectedsystems_osh.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@
from datetime import datetime
import json

from tests.utils import service_ok

import pytest

from owslib.ogcapi.connectedsystems import Commands, ControlChannels, Datastreams, Deployments, Observations, \
Properties, SamplingFeatures, SystemEvents, SystemHistory, Systems
from owslib.util import Authentication

# Directs to OSH (Open Sensor Hub) hosted test server
TEST_URL = 'http://34.67.197.57:8585/sensorhub/api/'

@pytest.fixture(scope="session")
def fixtures():
class OSHFixtures:
NODE_TEST_OK_URL = 'http://34.67.197.57:8585/sensorhub/test'
# Directs to OSH hosted test server
TEST_URL = 'http://34.67.197.57:8585/sensorhub/api/'
auth = Authentication('auto_test', 'automated_tester24')
sml_headers = {'Content-Type': 'application/sml+json'}
json_headers = {'Content-Type': 'application/json'}
Expand Down Expand Up @@ -214,6 +215,7 @@ def delete_all_sampling_features(self):
yield OSHFixtures()


@pytest.mark.skipif(not service_ok(TEST_URL), reason="OSH server is unreachable")
class TestSystems:
@pytest.mark.online
def test_system_readonly(self, fixtures):
Expand Down Expand Up @@ -255,6 +257,7 @@ def test_system_functions(self, fixtures):
assert res == {}


@pytest.mark.skipif(not service_ok(TEST_URL), reason="OSH server is unreachable")
class TestDeployments:
@pytest.mark.skip(reason="Skip transactional test")
def test_deployment_create(self, fixtures):
Expand All @@ -279,6 +282,7 @@ def test_deployment_delete(self, fixtures):
assert res is not None


@pytest.mark.skipif(not service_ok(TEST_URL), reason="OSH server is unreachable")
class TestSamplingFeatures:
@pytest.mark.online
def test_sampling_features_readonly(self, fixtures):
Expand Down Expand Up @@ -324,6 +328,7 @@ def test_sampling_features_all(self, fixtures):
assert res == {'items': []}


@pytest.mark.skipif(not service_ok(TEST_URL), reason="OSH server is unreachable")
class TestDatastreams:
@pytest.mark.online
def test_datastreams_readonly(self, fixtures):
Expand Down Expand Up @@ -369,6 +374,7 @@ def test_all_ds_functions(self, fixtures):
assert ds_delete == {}


@pytest.mark.skipif(not service_ok(TEST_URL), reason="OSH server is unreachable")
class TestObservations:
@pytest.mark.online
def test_observations_readonly(self, fixtures):
Expand Down Expand Up @@ -409,6 +415,7 @@ def test_observations(self, fixtures):
fixtures.delete_all_systems()


@pytest.mark.skipif(not service_ok(TEST_URL), reason="OSH server is unreachable")
class TestSystemHistory:
@pytest.mark.online
def test_system_history(self, fixtures):
Expand Down
Loading