File: test_ogcapi_features_ldproxy.py

package info (click to toggle)
owslib 0.23.0-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,176 kB
  • sloc: xml: 137,886; python: 20,041; makefile: 167; sh: 11
file content (29 lines) | stat: -rw-r--r-- 873 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from tests.utils import service_ok

import pytest

from owslib.ogcapi.features import Features

SERVICE_URL = 'https://www.ldproxy.nrw.de/rest/services/kataster/?f=json'


@pytest.mark.online
@pytest.mark.skipif(not service_ok(SERVICE_URL),
                    reason='service is unreachable')
def test_ogcapi_features_ldproxy():
    w = Features(SERVICE_URL)

    assert w.url == 'https://www.ldproxy.nrw.de/rest/services/kataster/'
    assert w.url_query_string == 'f=json'

    conformance = w.conformance()
    assert len(conformance['conformsTo']) == 5

    feature_collections = w.feature_collections()
    assert len(feature_collections) >= 0

    # TODO: remove pytest.raises once ldproxy is fixed/updated
    with pytest.raises(RuntimeError):
        api = w.api()
        assert api['components']['parameters'] is not None
        assert api['paths'] is not None