@@ -142,6 +142,41 @@ def testGetSchemasPath(self):
142142 base = settings .get_base_path ()
143143 self .assertEqual (join (base , 'lib' , 'schemas' ) + sep , settings .get_schemas_path ())
144144
145+ def testGetIdPSSOurl (self ):
146+ """
147+ Tests the get_idp_sso_url method of the OneLogin_Saml2_Settings class
148+ """
149+ settings_info = self .loadSettingsJSON ()
150+ settings = OneLogin_Saml2_Settings (settings_info )
151+
152+ sso_url = settings_info ['idp' ]['singleSignOnService' ]['url' ]
153+ self .assertEqual (settings .get_idp_sso_url (), sso_url )
154+
155+ def testGetIdPSLOurl (self ):
156+ """
157+ Tests the get_idp_slo_url method of the OneLogin_Saml2_Settings class
158+ """
159+ settings_info = self .loadSettingsJSON ()
160+ settings = OneLogin_Saml2_Settings (settings_info )
161+
162+ slo_url = settings_info ['idp' ]['singleLogoutService' ]['url' ]
163+ self .assertEqual (settings .get_idp_slo_url (), slo_url )
164+
165+ def testGetIdPSLOresponseUrl (self ):
166+ """
167+ Tests the get_idp_slo_response_url method of the OneLogin_Saml2_Settings class
168+ """
169+ settings_info = self .loadSettingsJSON ()
170+ settings_info ['idp' ]['singleLogoutService' ]['responseUrl' ] = "http://idp.example.com/SingleLogoutReturn.php"
171+ settings = OneLogin_Saml2_Settings (settings_info )
172+ slo_url = settings_info ['idp' ]['singleLogoutService' ]['responseUrl' ]
173+ self .assertEqual (settings .get_idp_slo_response_url (), slo_url )
174+ # test that the function falls back to the url setting if responseUrl is not set
175+ settings_info ['idp' ]['singleLogoutService' ].pop ('responseUrl' )
176+ settings = OneLogin_Saml2_Settings (settings_info )
177+ slo_url = settings_info ['idp' ]['singleLogoutService' ]['url' ]
178+ self .assertEqual (settings .get_idp_slo_response_url (), slo_url )
179+
145180 def testGetSPCert (self ):
146181 """
147182 Tests the get_sp_cert method of the OneLogin_Saml2_Settings
0 commit comments