<commit_before>from tests.utils import service_ok

import pytest

from owslib.wfs import WebFeatureService

SERVICE_URL = 'https://demo.pygeoapi.io/master'


@pytest.mark.online
@pytest.mark.skipif(not service_ok(SERVICE_URL),
                    reason='service is unreachable')
def test_wfs3_pygeoapi():
    w = WebFeatureService(SERVICE_URL, version='3.0')

    assert w.url == 'https://demo.pygeoapi.io/master/'
    assert w.version == '3.0'
    assert w.url_query_string is None

    api = w.api()
    assert api['components']['parameters'] is not None
    paths = api['paths']
    assert paths is not None
    assert paths['/collections/lakes'] is not None

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

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

    lakes = w.collection('lakes')
    assert lakes['id'] == 'lakes'
    assert lakes['title'] == 'Large Lakes'
    assert lakes['description'] == 'lakes of the world, public domain'

    lakes_query = w.collection_items('lakes', limit=0)
    assert lakes_query['numberMatched'] == 25
    assert lakes_query['numberReturned'] == 0
    assert len(lakes_query['features']) == 0<commit_msg>WFS3: fix tests to pass limit as positive integer (#618)<commit_after>from tests.utils import service_ok

import pytest

from owslib.wfs import WebFeatureService

SERVICE_URL = 'https://demo.pygeoapi.io/master'


@pytest.mark.online
@pytest.mark.skipif(not service_ok(SERVICE_URL),
                    reason='service is unreachable')
def test_wfs3_pygeoapi():
    w = WebFeatureService(SERVICE_URL, version='3.0')

    assert w.url == 'https://demo.pygeoapi.io/master/'
    assert w.version == '3.0'
    assert w.url_query_string is None

    api = w.api()
    assert api['components']['parameters'] is not None
    paths = api['paths']
    assert paths is not None
    assert paths['/collections/lakes'] is not None

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

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

    lakes = w.collection('lakes')
    assert lakes['id'] == 'lakes'
    assert lakes['title'] == 'Large Lakes'
    assert lakes['description'] == 'lakes of the world, public domain'

    lakes_query = w.collection_items('lakes', limit=1)
    assert lakes_query['numberMatched'] == 25
    assert lakes_query['numberReturned'] == 1
    assert len(lakes_query['features']) == 1
{'fraction_non_alphanumeric': 0.13191315034821793, 'fraction_numerical': 0.011470708725931995, 'mean_word_length': 3.7509727626459144, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2239167', 'n_tokens_mistral': 804, 'n_tokens_neox': 771, 'n_words': 190}