示例#1
0
    def test_search(self, mp_wfs, mp_remote_describefeaturetype, mp_remote_md,
                    mp_remote_fc, mp_remote_wfs_feature, mp_dov_xml):
        """Test the search method.

        Test whether a RuntimeError is raised.

        Parameters
        ----------
        mp_wfs : pytest.fixture
            Monkeypatch the call to the remote GetCapabilities request.
        mp_remote_describefeaturetype : pytest.fixture
            Monkeypatch the call to a remote DescribeFeatureType.
        mp_remote_md : pytest.fixture
            Monkeypatch the call to get the remote metadata.
        mp_remote_fc : pytest.fixture
            Monkeypatch the call to get the remote feature catalogue.
        mp_remote_wfs_feature : pytest.fixture
            Monkeypatch the call to get WFS features.
        mp_dov_xml : pytest.fixture
            Monkeypatch the call to get the remote XML data.

        """
        fs = GrondwaterFilterSearch(objecttype=MyWrongGrondwaterFilter)

        with pytest.raises(RuntimeError):
            fs.search(query=PropertyIsEqualTo(
                propertyname='filterfiche',
                literal='https://www.dov.vlaanderen.be/data/'
                'filter/2003-004471'))
示例#2
0
    def test_search(self, mp_wfs, mp_remote_describefeaturetype, mp_remote_md,
                    mp_remote_fc, mp_remote_wfs_feature, mp_dov_xml):
        """Test the search method.

        Test whether the extra fields from the custom type are resolved into
        data in the result dataframe.

        Parameters
        ----------
        mp_wfs : pytest.fixture
            Monkeypatch the call to the remote GetCapabilities request.
        mp_remote_describefeaturetype : pytest.fixture
            Monkeypatch the call to a remote DescribeFeatureType.
        mp_remote_md : pytest.fixture
            Monkeypatch the call to get the remote metadata.
        mp_remote_fc : pytest.fixture
            Monkeypatch the call to get the remote feature catalogue.
        mp_remote_wfs_feature : pytest.fixture
            Monkeypatch the call to get WFS features.
        mp_dov_xml : pytest.fixture
            Monkeypatch the call to get the remote XML data.

        """
        fs = GrondwaterFilterSearch(objecttype=MyGrondwaterFilter)

        df = fs.search(query=PropertyIsEqualTo(
            propertyname='filterfiche',
            literal='https://www.dov.vlaanderen.be/data/filter/2003-004471'))

        assert 'grondwatersysteem' in df
        assert df.iloc[0].grondwatersysteem == 'Centraal Vlaams Systeem'
示例#3
0
    def test_search(self, mp_wfs, mp_remote_describefeaturetype, mp_remote_md,
                    mp_remote_fc, mp_remote_wfs_feature, mp_dov_xml):
        """Test the search method.

        Test whether the extra fields from the custom type are resolved into
        data in the result dataframe.

        Parameters
        ----------
        mp_wfs : pytest.fixture
            Monkeypatch the call to the remote GetCapabilities request.
        mp_remote_describefeaturetype : pytest.fixture
            Monkeypatch the call to a remote DescribeFeatureType.
        mp_remote_md : pytest.fixture
            Monkeypatch the call to get the remote metadata.
        mp_remote_fc : pytest.fixture
            Monkeypatch the call to get the remote feature catalogue.
        mp_remote_wfs_feature : pytest.fixture
            Monkeypatch the call to get WFS features.
        mp_dov_xml : pytest.fixture
            Monkeypatch the call to get the remote XML data.

        """
        fs = GrondwaterFilterSearch(objecttype=MyGrondwaterFilterOpbouw)

        df = fs.search(query=PropertyIsEqualTo(propertyname='filterfiche',
                                               literal=build_dov_url(
                                                   'data/filter/2003-004471')))

        assert 'opbouw_van' in df
        assert 'opbouw_tot' in df
        assert 'opbouw_element' in df

        assert df.iloc[-1].opbouw_van == 2.5
        assert df.iloc[-1].opbouw_tot == 2.7
        assert df.iloc[-1].opbouw_element == 'zandvang'