@@ -148,29 +148,57 @@ def testGetCertPath(self):
148148 settings = OneLogin_Saml2_Settings (custom_base_path = self .settings_path )
149149 self .assertEqual (self .settings_path + sep + 'certs' + sep , settings .get_cert_path ())
150150
151- def testGetLibPath (self ):
151+ def testSetCertPath (self ):
152152 """
153- Tests getLibPath method of the OneLogin_Saml2_Settings
153+ Tests setCertPath method of the OneLogin_Saml2_Settings
154154 """
155155 settings = OneLogin_Saml2_Settings (custom_base_path = self .settings_path )
156- base = settings .get_base_path ()
157- self .assertEqual (join (base , 'lib' ) + sep , settings .get_lib_path ())
156+ self .assertEqual (self .settings_path + sep + 'certs' + sep , settings .get_cert_path ())
158157
159- def testGetExtLibPath (self ):
158+ settings .set_cert_path ('/tmp' )
159+ self .assertEqual ('/tmp' , settings .get_cert_path ())
160+
161+ def testGetLibPath (self ):
160162 """
161- Tests getExtLibPath method of the OneLogin_Saml2_Settings
163+ Tests getLibPath method of the OneLogin_Saml2_Settings
162164 """
165+ settingsInfo = self .loadSettingsJSON ()
166+ settings = OneLogin_Saml2_Settings (settingsInfo )
167+ path = settings .get_base_path ()
168+ self .assertEqual (settings .get_lib_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/' ))
169+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/../../../tests/data/customPath/' ))
170+
171+ del settingsInfo ['custom_base_path' ]
172+ settings = OneLogin_Saml2_Settings (settingsInfo )
173+ path = settings .get_base_path ()
174+ self .assertEqual (settings .get_lib_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/' ))
175+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/' ))
176+
163177 settings = OneLogin_Saml2_Settings (custom_base_path = self .settings_path )
164- base = settings .get_base_path ()
165- self .assertEqual (join (base , 'extlib' ) + sep , settings .get_ext_lib_path ())
178+ path = settings .get_base_path ()
179+ self .assertEqual (settings .get_lib_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/' ))
180+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (__file__ )))), 'settings/' ))
166181
167182 def testGetSchemasPath (self ):
168183 """
169184 Tests getSchemasPath method of the OneLogin_Saml2_Settings
170185 """
186+ settingsInfo = self .loadSettingsJSON ()
187+ settings = OneLogin_Saml2_Settings (settingsInfo )
188+ path = settings .get_base_path ()
189+ self .assertEqual (settings .get_schemas_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/schemas/' ))
190+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/../../../tests/data/customPath/' ))
191+
192+ del settingsInfo ['custom_base_path' ]
193+ settings = OneLogin_Saml2_Settings (settingsInfo )
194+ path = settings .get_base_path ()
195+ self .assertEqual (settings .get_schemas_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/schemas/' ))
196+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/' ))
197+
171198 settings = OneLogin_Saml2_Settings (custom_base_path = self .settings_path )
172- base = settings .get_base_path ()
173- self .assertEqual (join (base , 'lib' , 'schemas' ) + sep , settings .get_schemas_path ())
199+ path = settings .get_base_path ()
200+ self .assertEqual (settings .get_schemas_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/schemas/' ))
201+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (__file__ )))), 'settings/' ))
174202
175203 def testGetIdPSSOurl (self ):
176204 """
0 commit comments