@@ -125,29 +125,57 @@ def testGetCertPath(self):
125125 settings = OneLogin_Saml2_Settings (custom_base_path = self .settings_path )
126126 self .assertEqual (self .settings_path + sep + 'certs' + sep , settings .get_cert_path ())
127127
128- def testGetLibPath (self ):
128+ def testSetCertPath (self ):
129129 """
130- Tests getLibPath method of the OneLogin_Saml2_Settings
130+ Tests setCertPath method of the OneLogin_Saml2_Settings
131131 """
132132 settings = OneLogin_Saml2_Settings (custom_base_path = self .settings_path )
133- base = settings .get_base_path ()
134- self .assertEqual (join (base , 'lib' ) + sep , settings .get_lib_path ())
133+ self .assertEqual (self .settings_path + sep + 'certs' + sep , settings .get_cert_path ())
135134
136- def testGetExtLibPath (self ):
135+ settings .set_cert_path ('/tmp' )
136+ self .assertEqual ('/tmp' , settings .get_cert_path ())
137+
138+ def testGetLibPath (self ):
137139 """
138- Tests getExtLibPath method of the OneLogin_Saml2_Settings
140+ Tests getLibPath method of the OneLogin_Saml2_Settings
139141 """
142+ settingsInfo = self .loadSettingsJSON ()
143+ settings = OneLogin_Saml2_Settings (settingsInfo )
144+ path = settings .get_base_path ()
145+ self .assertEqual (settings .get_lib_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/' ))
146+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/../../../tests/data/customPath/' ))
147+
148+ del settingsInfo ['custom_base_path' ]
149+ settings = OneLogin_Saml2_Settings (settingsInfo )
150+ path = settings .get_base_path ()
151+ self .assertEqual (settings .get_lib_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/' ))
152+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/' ))
153+
140154 settings = OneLogin_Saml2_Settings (custom_base_path = self .settings_path )
141- base = settings .get_base_path ()
142- self .assertEqual (join (base , 'extlib' ) + sep , settings .get_ext_lib_path ())
155+ path = settings .get_base_path ()
156+ self .assertEqual (settings .get_lib_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/' ))
157+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (__file__ )))), 'settings/' ))
143158
144159 def testGetSchemasPath (self ):
145160 """
146161 Tests getSchemasPath method of the OneLogin_Saml2_Settings
147162 """
163+ settingsInfo = self .loadSettingsJSON ()
164+ settings = OneLogin_Saml2_Settings (settingsInfo )
165+ path = settings .get_base_path ()
166+ self .assertEqual (settings .get_schemas_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/schemas/' ))
167+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/../../../tests/data/customPath/' ))
168+
169+ del settingsInfo ['custom_base_path' ]
170+ settings = OneLogin_Saml2_Settings (settingsInfo )
171+ path = settings .get_base_path ()
172+ self .assertEqual (settings .get_schemas_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/schemas/' ))
173+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/' ))
174+
148175 settings = OneLogin_Saml2_Settings (custom_base_path = self .settings_path )
149- base = settings .get_base_path ()
150- self .assertEqual (join (base , 'lib' , 'schemas' ) + sep , settings .get_schemas_path ())
176+ path = settings .get_base_path ()
177+ self .assertEqual (settings .get_schemas_path (), join (dirname (dirname (dirname (dirname (dirname (__file__ ))))), 'src/onelogin/saml2/schemas/' ))
178+ self .assertEqual (path , join (dirname (dirname (dirname (dirname (__file__ )))), 'settings/' ))
151179
152180 def testGetIdPSSOurl (self ):
153181 """
0 commit comments