Skip to content

Commit

Permalink
match list length xx with xx_url (don't remove None, set as '')
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgenuchten committed Nov 7, 2024
1 parent a0e2029 commit 7a08683
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions owslib/iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def testAllCharOrAnchor(md,xpath,aslist=True):
if aslist:
return ro
else:
return {'name': [i['name'] for i in ro if i['name'] not in [None,'']],
'url': [i['url'] for i in ro if i['url'] not in [None,'']]}
return {'name': [i.get('name', '') for i in ro],
'url': [i.get('url', '') for i in ro]}



Expand Down
2 changes: 1 addition & 1 deletion tests/test_iso_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_md_parsing_dov():

assert_list(iden.otherconstraints, 2)
assert iden.otherconstraints_url[
0] == "https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply"
1] == "https://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply"
assert iden.otherconstraints[
0] == "Data beschikbaar voor hergebruik volgens de " \
"Modellicentie Gratis Hergebruik. Toelichting " \
Expand Down

0 comments on commit 7a08683

Please sign in to comment.