File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1445,7 +1445,7 @@ def registration_info(self, entity_id):
1445
1445
if elem ["__class__" ] == classnames ["mdrpi_registration_info" ]:
1446
1446
res ["registration_authority" ] = elem ["registration_authority" ]
1447
1447
res ["registration_instant" ] = elem .get ("registration_instant" )
1448
- for policy in elem .get ('registration_policy' ):
1448
+ for policy in elem .get ('registration_policy' , list () ):
1449
1449
if policy ["__class__" ] == classnames ["mdrpi_registration_policy" ]:
1450
1450
res ['registration_policy' ][policy ["lang" ]] = policy ["text" ]
1451
1451
return res
Original file line number Diff line number Diff line change @@ -575,6 +575,16 @@ def test_registration_info():
575
575
registration_info ['registration_policy' ]['en' ]
576
576
577
577
578
+ def test_registration_info_no_policy ():
579
+ mds = MetadataStore (ATTRCONV , sec_config ,
580
+ disable_ssl_certificate_validation = True )
581
+ mds .imp (METADATACONF ["13" ])
582
+ registration_info = mds .registration_info (entity_id = 'https://idp.szie.hu/idp/shibboleth' )
583
+ assert 'http://eduid.hu' == registration_info ['registration_authority' ]
584
+ assert registration_info ['registration_instant' ] is None
585
+ assert registration_info ['registration_policy' ] == {}
586
+
587
+
578
588
def test_extension ():
579
589
mds = MetadataStore (ATTRCONV , None )
580
590
# use ordered dict to force expected entity to be last
You can’t perform that action at this time.
0 commit comments