Skip to content

Commit

Permalink
Add iso_3 service tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vjf committed Jan 3, 2024
1 parent 9011d50 commit 350dc3b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion owslib/iso_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ def __init__(self, namespaces, md=None):
'srv:SV_OperationMetadata/srv:operationName/gco:CharacterString', self.namespaces))
tmp['name'] = util.testXMLValue(val)
tmp['dcplist'] = []
for d in i.findall(util.nspath_eval('srv:SV_OperationMetadata/srv:DCP', self.namespaces)):
for d in i.findall(util.nspath_eval('srv:SV_OperationMetadata/srv:distributedComputingPlatform', self.namespaces)):
tmp2 = _testCodeListValue(d.find(util.nspath_eval('srv:DCPList', self.namespaces)))
tmp['dcplist'].append(tmp2)

Expand Down
24 changes: 23 additions & 1 deletion tests/test_iso3_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

pytestmark = pytest.mark.unit


@pytest.fixture
def ns():
""" Create a V2 namespace
Expand Down Expand Up @@ -521,7 +522,6 @@ def test_md_featurecataloguedesc(emd):
""" Tests MD_FeatureCatalogueDescription
"""
assert emd is not None
print(emd.format_me())
cont_info = emd.contentinfo[0]
assert cont_info.compliancecode == True
assert cont_info.includedwithdataset == True
Expand Down Expand Up @@ -556,3 +556,25 @@ def test_dq_dataquality(emd):
assert dq.lineage_url == None
assert dq.specificationtitle == 'Resource > Data Quality > Report > Conformance Result > Specification > Titles > Title (Type=Domain Consistency)'
assert dq.specificationdate[0] == '2010-07-01T00:00:00'

def test_md_reference_system(emd):
""" Tests MD_ReferenceSystem
"""
assert emd is not None
assert emd.referencesystem.code == 'Resource > Spatial Reference > Reference System > Code'
assert emd.referencesystem.codeSpace == 'Resource > Spatial Reference > Reference System > Code Space'
assert emd.referencesystem.version == 'Resource > Spatial Reference > Reference System > Version'
print(emd.format_me())

def test_service2(emd):
""" Tests SV_ServiceIdentification fields not present in other sources
"""
assert emd is not None
srv_ident = emd.identification[0]
assert(isinstance(srv_ident, SV_ServiceIdentification))
assert(srv_ident.type == "Resource > Service Details > Service Type > Name")
assert(srv_ident.version == "Resource > Service Details > Service Type Version")
assert(srv_ident.couplingtype == 'loose')
assert(srv_ident.fees == "Resource > Service Details > Access Properties > Fees")


0 comments on commit 350dc3b

Please sign in to comment.