# Path: pydov/search/boring.py
# class BoringSearch(AbstractSearch):
#     """Search class to retrieve information about boreholes (Boring)."""
# 
#     def __init__(self, objecttype=Boring):
#         """Initialisation.
# 
#         Parameters
#         ----------
#         objecttype : subclass of pydov.types.abstract.AbstractDovType
#             Reference to a class representing the Boring type.
#             Optional: defaults to the Boring type containing the fields
#             described in the documentation.
# 
#         """
#         super(BoringSearch, self).__init__('dov-pub:Boringen', objecttype)
# 
# Path: pydov/search/interpretaties.py
# class LithologischeBeschrijvingenSearch(AbstractSearch):
#     """Search class to retrieve lithologische beschrijvingen """
# 
#     def __init__(self, objecttype=LithologischeBeschrijvingen):
#         """Initialisation.
# 
#         Parameters
#         ----------
#         objecttype : subclass of pydov.types.abstract.AbstractDovType
#             Reference to a class representing the LithologischeBeschrijvingen
#             type. Optional: defaults to the LithologischeBeschrijvingen type
#             containing the fields described in the documentation.
# 
#         """
#         super(LithologischeBeschrijvingenSearch, self).__init__(
#             'interpretaties:lithologische_beschrijvingen',
#             objecttype)
# 
# Path: pydov/util/dovutil.py
# def build_dov_url(path):
#     """Build the DOV url consisting of the fixed DOV base url, appended with
#     the given path.
# 
#     Returns
#     -------
#     str
#         The absolute DOV url.
# 
#     """
#     if 'PYDOV_BASE_URL' in os.environ:
#         base_url = os.environ['PYDOV_BASE_URL']
#     else:
#         base_url = 'https://www.dov.vlaanderen.be/'
# 
#     return base_url + path.lstrip('/')
# 
# Path: pydov/util/errors.py
# class XmlParseWarning(DOVWarning):
#     """Emitted when the failure to parse an XML document results in
#     an incomplete dataframe."""
# 
# Path: tests/abstract.py
# class ServiceCheck:
# 
#     is_service_ok = None
# 
#     @staticmethod
#     def service_ok(timeout=5):
#         """Check whether DOV services are accessible.
# 
#         Used to skip online tests when the service is unavailable or
#         unreachable.
# 
#         Parameters
#         ----------
#         timeout : int, optional
#             Timeout in seconds. Defaults to 5.
# 
#         Returns
#         -------
#         bool
#             True if the DOV services are reachable, False otherwise.
# 
#         """
#         def check_url(url, timeout):
#             try:
#                 ok = pydov.session.head(
#                     url, allow_redirects=True, timeout=timeout).ok
#             except requests.exceptions.ReadTimeout:
#                 ok = False
#             except requests.exceptions.ConnectTimeout:
#                 ok = False
#             except Exception:
#                 ok = False
#             return ok
# 
#         if ServiceCheck.is_service_ok is None:
#             ServiceCheck.is_service_ok = (
#                 check_url(build_dov_url('geoserver'), timeout) and
#                 check_url(build_dov_url('geonetwork'), timeout) and
#                 check_url(
#                     build_dov_url('xdov/schema/latest/xsd/kern/dov.xsd'),
#                     timeout))
# 
#         return ServiceCheck.is_service_ok
# 
# Path: tests/test_search_itp_lithologischebeschrijvingen.py
# class TestLithologischeBeschrijvingenSearch(AbstractTestSearch):
#     def test_search_customreturnfields(self, mp_get_schema,
#                                        mp_remote_describefeaturetype,
#                                        mp_remote_wfs_feature, mp_dov_xml):
#     def test_search_xml_resolve(self, mp_get_schema,
#                                 mp_remote_describefeaturetype,
#                                 mp_remote_wfs_feature, mp_dov_xml):


import datetime
import gzip
import os
import time
import pandas as pd
import pytest
            import lxml
from owslib.fes import PropertyIsEqualTo
from pydov.search.boring import BoringSearch
from pydov.search.interpretaties import LithologischeBeschrijvingenSearch
from pydov.util.dovutil import build_dov_url
from pydov.util.errors import XmlParseWarning
from tests.abstract import ServiceCheck
from tests.test_search_itp_lithologischebeschrijvingen import (
    location_fc_featurecatalogue, location_md_metadata,
    location_wfs_describefeaturetype, location_wfs_getfeature)

        assert cached_data == ref_data

    @pytest.mark.online
    @pytest.mark.skipif(not ServiceCheck.service_ok(),
                        reason="DOV service is unreachable")
    @pytest.mark.parametrize('gziptext_cache',
                             [[datetime.timedelta(minutes=15)]],
                             indirect=['gziptext_cache'])
    def test_reuse_content_gziptext(self, gziptext_cache):
        """Test the caching of an XML containing strange characters.

        Test if the contents returned by the cache are the same as the
        original data.

        Parameters
        ----------
        gziptext_cache : pytest.fixture providing
                pydov.util.caching.GzipTextFileCache
            GzipTextFileCache using a temporary directory and a maximum age
            of 1 second.

        """
        cached_file = os.path.join(
            gziptext_cache.cachedir, 'boring', '1995-056089.xml.gz')

        gziptext_cache.remove()
        assert not os.path.exists(cached_file)

        ref_data = gziptext_cache.get(

# Path: pydov/search/boring.py
# class BoringSearch(AbstractSearch):
#     """Search class to retrieve information about boreholes (Boring)."""
# 
#     def __init__(self, objecttype=Boring):
#         """Initialisation.
# 
#         Parameters
#         ----------
#         objecttype : subclass of pydov.types.abstract.AbstractDovType
#             Reference to a class representing the Boring type.
#             Optional: defaults to the Boring type containing the fields
#             described in the documentation.
# 
#         """
#         super(BoringSearch, self).__init__('dov-pub:Boringen', objecttype)
# 
# Path: pydov/search/interpretaties.py
# class LithologischeBeschrijvingenSearch(AbstractSearch):
#     """Search class to retrieve lithologische beschrijvingen """
# 
#     def __init__(self, objecttype=LithologischeBeschrijvingen):
#         """Initialisation.
# 
#         Parameters
#         ----------
#         objecttype : subclass of pydov.types.abstract.AbstractDovType
#             Reference to a class representing the LithologischeBeschrijvingen
#             type. Optional: defaults to the LithologischeBeschrijvingen type
#             containing the fields described in the documentation.
# 
#         """
#         super(LithologischeBeschrijvingenSearch, self).__init__(
#             'interpretaties:lithologische_beschrijvingen',
#             objecttype)
# 
# Path: pydov/util/dovutil.py
# def build_dov_url(path):
#     """Build the DOV url consisting of the fixed DOV base url, appended with
#     the given path.
# 
#     Returns
#     -------
#     str
#         The absolute DOV url.
# 
#     """
#     if 'PYDOV_BASE_URL' in os.environ:
#         base_url = os.environ['PYDOV_BASE_URL']
#     else:
#         base_url = 'https://www.dov.vlaanderen.be/'
# 
#     return base_url + path.lstrip('/')
# 
# Path: pydov/util/errors.py
# class XmlParseWarning(DOVWarning):
#     """Emitted when the failure to parse an XML document results in
#     an incomplete dataframe."""
# 
# Path: tests/abstract.py
# class ServiceCheck:
# 
#     is_service_ok = None
# 
#     @staticmethod
#     def service_ok(timeout=5):
#         """Check whether DOV services are accessible.
# 
#         Used to skip online tests when the service is unavailable or
#         unreachable.
# 
#         Parameters
#         ----------
#         timeout : int, optional
#             Timeout in seconds. Defaults to 5.
# 
#         Returns
#         -------
#         bool
#             True if the DOV services are reachable, False otherwise.
# 
#         """
#         def check_url(url, timeout):
#             try:
#                 ok = pydov.session.head(
#                     url, allow_redirects=True, timeout=timeout).ok
#             except requests.exceptions.ReadTimeout:
#                 ok = False
#             except requests.exceptions.ConnectTimeout:
#                 ok = False
#             except Exception:
#                 ok = False
#             return ok
# 
#         if ServiceCheck.is_service_ok is None:
#             ServiceCheck.is_service_ok = (
#                 check_url(build_dov_url('geoserver'), timeout) and
#                 check_url(build_dov_url('geonetwork'), timeout) and
#                 check_url(
#                     build_dov_url('xdov/schema/latest/xsd/kern/dov.xsd'),
#                     timeout))
# 
#         return ServiceCheck.is_service_ok
# 
# Path: tests/test_search_itp_lithologischebeschrijvingen.py
# class TestLithologischeBeschrijvingenSearch(AbstractTestSearch):
#     def test_search_customreturnfields(self, mp_get_schema,
#                                        mp_remote_describefeaturetype,
#                                        mp_remote_wfs_feature, mp_dov_xml):
#     def test_search_xml_resolve(self, mp_get_schema,
#                                 mp_remote_describefeaturetype,
#                                 mp_remote_wfs_feature, mp_dov_xml):


# Path: tests/test_encoding.py
import datetime
import gzip
import os
import time
import pandas as pd
import pytest
            import lxml
from owslib.fes import PropertyIsEqualTo
from pydov.search.boring import BoringSearch
from pydov.search.interpretaties import LithologischeBeschrijvingenSearch
from pydov.util.dovutil import build_dov_url
from pydov.util.errors import XmlParseWarning
from tests.abstract import ServiceCheck
from tests.test_search_itp_lithologischebeschrijvingen import (
    location_fc_featurecatalogue, location_md_metadata,
    location_wfs_describefeaturetype, location_wfs_getfeature)


        assert cached_data == ref_data

    @pytest.mark.online
    @pytest.mark.skipif(not ServiceCheck.service_ok(),
                        reason="DOV service is unreachable")
    @pytest.mark.parametrize('gziptext_cache',
                             [[datetime.timedelta(minutes=15)]],
                             indirect=['gziptext_cache'])
    def test_reuse_content_gziptext(self, gziptext_cache):
        """Test the caching of an XML containing strange characters.

        Test if the contents returned by the cache are the same as the
        original data.

        Parameters
        ----------
        gziptext_cache : pytest.fixture providing
                pydov.util.caching.GzipTextFileCache
            GzipTextFileCache using a temporary directory and a maximum age
            of 1 second.

        """
        cached_file = os.path.join(
            gziptext_cache.cachedir, 'boring', '1995-056089.xml.gz')

        gziptext_cache.remove()
        assert not os.path.exists(cached_file)

        ref_data = gziptext_cache.get(

            build_dov_url('data/boring/1995-056089.xml'))