def test_get_remote_metadata_nometadataurls(self, wfs): """Test the owsutil.get_remote_metadata method when the WFS layer missed metadata URLs. Test whether a MetadataNotFoundError is raised. Parameters ---------- wfs : pytest.fixture returning owslib.wfs.WebFeatureService WebFeatureService based on the local GetCapabilities. """ contents = copy.deepcopy(wfs.contents) contentmetadata = contents['dov-pub:Boringen'] contentmetadata.metadataUrls = [] with pytest.raises(MetadataNotFoundError): owsutil.get_remote_metadata(contentmetadata)
def _get_remote_metadata(self): """Request and parse the remote metadata associated with the layer. Returns ------- owslib.iso.MD_Metadata Parsed remote metadata describing the WFS layer in more detail, in the ISO 19115/19139 format. """ wfs_layer = self._get_layer() return owsutil.get_remote_metadata(wfs_layer)
def md_metadata(wfs, mp_remote_md): """PyTest fixture providing a MD_Metadata instance of the dov-pub:Boringen layer. Parameters ---------- wfs : pytest.fixture returning owslib.wfs.WebFeatureService WebFeatureService based on the local GetCapabilities. mp_remote_md : pytest.fixture Monkeypatch the call to get the remote metadata of the dov-pub:Boringen layer. Returns ------- owslib.iso.MD_Metadata Parsed metadata describing the Boringen WFS layer in more detail, in the ISO 19115/19139 format. """ contentmetadata = wfs.contents['dov-pub:Boringen'] return owsutil.get_remote_metadata(contentmetadata)