File: test_csw_pycsw.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 (22 lines) | stat: -rw-r--r-- 685 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from tests.utils import service_ok

import pytest

from owslib.csw import CatalogueServiceWeb as cs

SERVICE_URL = 'http://demo.pycsw.org/cite/csw'


@pytest.mark.online
@pytest.mark.skipif(not service_ok(SERVICE_URL),
                    reason='service is unreachable')
def test_csw_pycsw():
    c = cs(SERVICE_URL)
    assert c.updateSequence is not None
    assert c.version == '2.0.2'
    assert c.identification.title == 'pycsw OGC CITE demo and Reference Implementation'
    assert c.constraints['MaxRecordDefault'].values[0] == '10'
    c.getrecords2()
    assert c.results.get('returned') > 0
    assert c.results.get('nextrecord') > 0
    assert c.results.get('matches') > 0