diff options
-rw-r--r-- | src/saml2/mdstore.py | 9 | ||||
-rw-r--r-- | tests/test_30_mdstore.py | 8 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/saml2/mdstore.py b/src/saml2/mdstore.py index 7aa458f8..ce4c8789 100644 --- a/src/saml2/mdstore.py +++ b/src/saml2/mdstore.py @@ -1543,6 +1543,15 @@ class MetadataStore(MetaData): return elements def sbibmd_scopes(self, entity_id, typ=None): + warn_msg = ( + "`saml2.mdstore.MetadataStore::sbibmd_scopes` method is deprecated; " + "instead, use `saml2.mdstore.MetadataStore::shibmd_scopes`." + ) + logger.warning(warn_msg) + _warn(warn_msg, DeprecationWarning) + return self.shibmd_scopes(entity_id, typ=typ) + + def shibmd_scopes(self, entity_id, typ=None): try: md = self[entity_id] except KeyError: diff --git a/tests/test_30_mdstore.py b/tests/test_30_mdstore.py index b35a206f..1531f058 100644 --- a/tests/test_30_mdstore.py +++ b/tests/test_30_mdstore.py @@ -666,7 +666,7 @@ def test_shibmd_scope_no_regex_no_descriptor_type(): mds = MetadataStore(ATTRCONV, sec_config, disable_ssl_certificate_validation=True) mds.imp(METADATACONF["15"]) - scopes = mds.sbibmd_scopes(entity_id='http://example.com/saml2/idp.xml') + scopes = mds.shibmd_scopes(entity_id='http://example.com/saml2/idp.xml') all_scopes = list(scopes) expected = [ @@ -676,7 +676,7 @@ def test_shibmd_scope_no_regex_no_descriptor_type(): }, { "regexp": True, - "text": regex_compile("descriptor-example[^0-9]*\.org"), + "text": regex_compile(r"descriptor-example[^0-9]*\.org"), }, ] assert len(all_scopes) == 2 @@ -687,7 +687,7 @@ def test_shibmd_scope_no_regex_all_descriptors(): mds = MetadataStore(ATTRCONV, sec_config, disable_ssl_certificate_validation=True) mds.imp(METADATACONF["15"]) - scopes = mds.sbibmd_scopes(entity_id='http://example.com/saml2/idp.xml', typ="idpsso_descriptor") + scopes = mds.shibmd_scopes(entity_id='http://example.com/saml2/idp.xml', typ="idpsso_descriptor") all_scopes = list(scopes) expected = [ { @@ -696,7 +696,7 @@ def test_shibmd_scope_no_regex_all_descriptors(): }, { "regexp": True, - "text": regex_compile("descriptor-example[^0-9]*\.org"), + "text": regex_compile(r"descriptor-example[^0-9]*\.org"), }, { "regexp": False, |