Skip to content

Commit

Permalink
fix #39: CompanyName check
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Jun 2, 2021
1 parent d51dda2 commit 889a40a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def readme():

setup(
name='spid_sp_test',
version='0.6.2',
version='0.6.3',
description="SAML2 SPID Service Provider validation tool that can be run from the command line",
long_description=readme(),
long_description_content_type='text/markdown',
Expand Down
11 changes: 0 additions & 11 deletions src/spid_sp_test/metadata_private.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ def test_Contacts_Priv(self):

if exts:
ext = exts[0]
company = self.doc.xpath(
'//ContactPerson/Extensions/CessionarioCommittente/CompanyName'
)
if company:
company = company[0]
self._assertTrue(
company.text,
'If the Company element is present it MUST have a value',
description = company,
)

tise = self.doc.xpath(
'//ContactPerson/Extensions/CessionarioCommittente/TerzoIntermediarioSoggettoEmittente'
)
Expand Down
9 changes: 8 additions & 1 deletion src/spid_sp_test/metadata_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ def test_Extensions_PubPriv(self):
orgs = self.doc.xpath('//EntityDescriptor/Organization/OrganizationName')
if len(orgs) >= 1:
org = orgs[0]
company = self.doc.xpath('//ContactPerson/Extensions/CompanyName')
company = self.doc.xpath('//ContactPerson/CompanyName')
if company:
company = company[0]

self._assertTrue(
company.text,
'If the Company element is present it MUST have a value',
description = company,
)

self._assertTrue(
company.text == org.text,
'If the Company element if present it MUST be equal to OrganizationName',
Expand Down

0 comments on commit 889a40a

Please sign in to comment.