1818from onelogin .saml2 .settings import OneLogin_Saml2_Settings
1919from onelogin .saml2 .utils import OneLogin_Saml2_Utils
2020
21+
2122class OneLogin_Saml2_Response_Test (unittest .TestCase ):
2223 data_path = join (dirname (dirname (dirname (dirname (__file__ )))), 'data' )
2324 settings_path = join (dirname (dirname (dirname (dirname (__file__ )))), 'settings' )
@@ -54,7 +55,7 @@ def get_request_data_domain_capitalized(self):
5455 'http_host' : 'StuFF.Com' ,
5556 'script_name' : 'endpoints/endpoints/acs.php'
5657 }
57-
58+
5859 def get_request_data_path_capitalized (self ):
5960 return {
6061 'http_host' : 'stuff.com' ,
@@ -1018,7 +1019,7 @@ def testIsInValidDuplicatedAttrs(self):
10181019 response = OneLogin_Saml2_Response (settings , xml )
10191020 with self .assertRaisesRegex (Exception , 'Found an Attribute element with duplicated Name' ):
10201021 response .get_attributes ()
1021-
1022+
10221023 def testIsInValidDestination (self ):
10231024 """
10241025 Tests the is_valid method of the OneLogin_Saml2_Response class
@@ -1065,17 +1066,16 @@ def testIsInValidDestinationCapitalizationOfElements(self):
10651066 Tests the is_valid method of the OneLogin_Saml2_Response class
10661067 Case Invalid Response due to differences in capitalization of path
10671068 """
1068-
10691069 settings = OneLogin_Saml2_Settings (self .loadSettingsJSON ())
10701070 message = self .file_contents (join (self .data_path , 'responses' , 'unsigned_response.xml.base64' ))
1071-
1072- #Test path capitalized
1071+
1072+ # Test path capitalized
10731073 settings .set_strict (True )
10741074 response = OneLogin_Saml2_Response (settings , message )
10751075 self .assertFalse (response .is_valid (self .get_request_data_path_capitalized ()))
10761076 self .assertIn ('The response was received at' , response .get_error ())
10771077
1078- #Test both domain and path capitalized
1078+ # Test both domain and path capitalized
10791079 response_2 = OneLogin_Saml2_Response (settings , message )
10801080 self .assertFalse (response_2 .is_valid (self .get_request_data_both_capitalized ()))
10811081 self .assertIn ('The response was received at' , response_2 .get_error ())
@@ -1087,13 +1087,13 @@ def testIsValidDestinationCapitalizationOfHost(self):
10871087 """
10881088 settings = OneLogin_Saml2_Settings (self .loadSettingsJSON ())
10891089 message = self .file_contents (join (self .data_path , 'responses' , 'unsigned_response.xml.base64' ))
1090- #Test domain capitalized
1090+ # Test domain capitalized
10911091 settings .set_strict (True )
10921092 response = OneLogin_Saml2_Response (settings , message )
10931093 self .assertFalse (response .is_valid (self .get_request_data_domain_capitalized ()))
10941094 self .assertNotIn ('The response was received at' , response .get_error ())
10951095
1096- #Assert we got past the destination check, which appears later
1096+ # Assert we got past the destination check, which appears later
10971097 self .assertIn ('A valid SubjectConfirmation was not found' , response .get_error ())
10981098
10991099 def testIsInValidAudience (self ):
0 commit comments