Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metadata] Mysterious non-unique ContactPerson constraint check failure #125

Closed
longstoned opened this issue Apr 20, 2022 · 4 comments
Closed

Comments

@longstoned
Copy link

longstoned commented Apr 20, 2022

Hi,

not a Python expert at all, firstly.
I am experiencing a strange validation error, possibile related to the line in [1] but I am confused.
For v. 1.1.5 of spid_sp_test I am getting the following:

ERROR:spid_sp_test.metadata:SpidSpMetadataCheck.test_Contacts_PubPriv: Only one ContactPerson element of contactType "other" MUST be present
ERROR:spid_sp_test.metadata:Only one ContactPerson element of contactType "other" MUST be `present`

for a pub-ag-full SP with this kind of structure (Contacts section, edited here):

 <md:ContactPerson contactType="other" spid:entityType="spid:**aggregator**">
                <md:Extensions>
                        <spid:VATNumber>IT02770800000</spid:VATNumber>
                        <spid:PublicServicesFullAggregator/>
                </md:Extensions>
                <md:Company>myCompany Ltd</md:Company>
                <md:EmailAddress>support@mycompany.it</md:EmailAddress>
        </md:ContactPerson>
        <md:ContactPerson contactType="other" spid:entityType="spid:**aggregated**">
                <md:Extensions>
                        <spid:IPACode>COM678</spid:IPACode>
                        <spid:Public/>
                </md:Extensions>
                <md:Company>Comune di Topolinia</md:Company>
        </md:ContactPerson>

This structure should be supported and non error-flagged...
Actually I identified [1] but I am NOT entirely convinced it is there the problem (supposing my XML metadata is fine).. because the function defintion uses (apparently...) some default parameter values, here's the signature:
def test_Contacts_PubPriv(self, contact_type="other", entity_type="")

and entityType..seems to be set correctly... which makes me wonder.. why is the Xpath/code triggering the error?
Seems like.. this section is triggered:

if not entity_type:
           self._assertTrue(
               len(entity_desc) == 1,
               "Only one ContactPerson element of contactType "
               f'"{contact_type}" MUST be present',
               test_id = ['1.10.0'], **_data,
           )

which.. looks impossible if I understand correctly the call from [1]...
Also strange... immediately following [1] there's another call with another entityType.. so.. I would expect 2 (two) errors... (one for aggregated and one for aggregator)..

Is this XML structure really incorrect? or there's some..ghost call around or I don't know exactly how to say it.

Thank you.

Diego

[1]

self.test_Contacts_PubPriv(entity_type="spid:aggregator")

@peppelinux
Copy link
Member

Ciao @longstoned

can you share the spid-sp-test command you used?
do you configure the correct --profile for soggetto aggregatore?

@longstoned
Copy link
Author

Ciao @peppelinux :)

Hmm.. no --profile issued, so possibly my bad.
I just used spid_sp_test --metadata-url <my_meta_url> as in some examples and got many constraint checks performed, with final output summary as below.
Actually, i don't see any --profile option via spid_sp_test -h (on 1.1.5)

Summary:
Spid QA: executed 127 tests, 1 failed. 0 warnings.

@peppelinux
Copy link
Member

see -h and configure the right profile for your SP

@longstoned
Copy link
Author

ohhh I see...
There's -pr option which also has --profile but it's a quite a bit hidden after all the possible values

Summary now (with --profile spid-sp-ag-public-full )

Spid QA: executed 135 tests, 0 failed. 0 warnings.

Thanks a lot @peppelinux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants