Skip to content

Commit

Permalink
fix: Extentions inside ContactPerson
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Jun 1, 2021
1 parent 33b30c8 commit 9f3e070
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/spid_sp_test/metadata_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,19 @@ def test_Contacts_PubPriv(self, contact_type="other"):
return self.is_ok(f'{self.__class__.__name__}.test_Contacts_PubPriv')

def test_Extensions_PubPriv(self):
exts = self.doc.xpath('//ContactPerson/Extensions')
self._assertTrue(
len(exts) == 1,
'Only one Extensions element inside ContactPerson element MUST be present',
description = exts
)
_conts = self.doc.xpath('//ContactPerson')

for cont in _conts:
ext_cnt = 0
for child in cont.getchildren():
if child.tag == 'Extension':
ext_cnt += 1

self._assertFalse(
ext_cnt > 1,
'Only one Extensions element inside ContactPerson element MUST be present',
description = etree.tostring(cont).decode()
)

orgs = self.doc.xpath('//EntityDescriptor/Organization/OrganizationName')
if len(orgs) >= 1:
Expand Down

0 comments on commit 9f3e070

Please sign in to comment.