Skip to content

Commit a281bc5

Browse files
committed
pep8 fixes
1 parent 33f427c commit a281bc5

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

tests/src/OneLogin/saml2_tests/logout_response_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def testIsValidWithCapitalization(self):
297297
response_2.is_valid(request_data, raise_exceptions=True)
298298

299299
plain_message = compat.to_string(OneLogin_Saml2_Utils.decode_base64_and_inflate(message))
300-
300+
301301
current_url = OneLogin_Saml2_Utils.get_self_url_no_query(request_data).lower()
302302
plain_message = plain_message.replace('http://stuff.com/endpoints/endpoints/sls.php', current_url)
303303
message_3 = OneLogin_Saml2_Utils.deflate_and_base64_encode(plain_message)
@@ -333,7 +333,6 @@ def testIsInValidWithCapitalization(self):
333333
response_3 = OneLogin_Saml2_Logout_Response(settings, message_3)
334334
self.assertFalse(response_3.is_valid(request_data))
335335

336-
337336
def testIsValidWithXMLEncoding(self):
338337
"""
339338
Tests the is_valid method of the OneLogin_Saml2_LogoutResponse

tests/src/OneLogin/saml2_tests/response_test.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from onelogin.saml2.settings import OneLogin_Saml2_Settings
1919
from onelogin.saml2.utils import OneLogin_Saml2_Utils
2020

21+
2122
class 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):

tests/src/OneLogin/saml2_tests/settings_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def testGetSchemasPath(self):
198198
settings = OneLogin_Saml2_Settings(custom_base_path=self.settings_path)
199199
path = settings.get_base_path()
200200
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/'))
201+
self.assertEqual(path, join(dirname(dirname(dirname(dirname(__file__)))), 'settings/'))
202202

203203
def testGetIdPSSOurl(self):
204204
"""

0 commit comments

Comments
 (0)