Skip to content

Commit

Permalink
add tests for anchor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgenuchten committed Oct 8, 2024
1 parent a8b0a2c commit 83e8568
Show file tree
Hide file tree
Showing 3 changed files with 654 additions and 4 deletions.
22 changes: 18 additions & 4 deletions owslib/iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def __init__(self, md=None, identtype=None):
namespaces))
for i in _values:
val = util.testXMLValue(i)
if val is not None:
if val not in [None,'']:
self.uricode.append(val)

_values = md.findall(util.nspath_eval(
Expand All @@ -424,17 +424,31 @@ def __init__(self, md=None, identtype=None):
'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/gmx:Anchor',
namespaces))
for i in _values:
val = util.testXMLValue(i.attrib.get('xlink:href'), True)
if val is not None:
val = util.testXMLValue(i)
val1 = i.attrib.get(util.nspath_eval('xlink:href', namespaces))
if val1 not in [None,'']:
self.uricode.append(val1)
elif val not in [None,'']:
self.uricode.append(val)


self.uricodespace = []
for i in md.findall(util.nspath_eval(
'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:codeSpace/gco:CharacterString',
namespaces)):
val = util.testXMLValue(i)
if val is not None:
if val not in [None,'']:
self.uricodespace.append(val)
for i in md.findall(util.nspath_eval(
'gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:codeSpace/gmx:Anchor',
namespaces)):
val = util.testXMLValue(i)
val1 = i.attrib.get(util.nspath_eval('xlink:href', namespaces))
if val1 not in [None,'']:
self.uricode.append(val1)
elif val not in [None,'']:
self.uricode.append(val)


self.date = []
self.datetype = []
Expand Down
Loading

0 comments on commit 83e8568

Please sign in to comment.