Skip to content

Commit 42a18e3

Browse files
committed
Sem-Ver: bugfix Fix some issues that flake8 detected.
Signed-off-by: David Black <[email protected]>
1 parent 5714c7f commit 42a18e3

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

atlassian_jwt_auth/frameworks/django/tests/test_django.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ def test_request_subject_does_need_to_match_issuer_override_settings(self):
318318
)
319319
with override_settings(**dict(
320320
self.test_settings, ASAP_SUBJECT_SHOULD_MATCH_ISSUER=False)):
321-
message = 'Issuer does not match the subject'
322321
response = self.client.get(
323322
reverse('subject_does_need_to_match_issuer'),
324323
HTTP_AUTHORIZATION=b'Bearer ' + token)

atlassian_jwt_auth/frameworks/wsgi/tests/test_wsgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test_request_with_valid_token_is_allowed(self):
6161
self.assertEqual(resp_info['status'], '200 OK')
6262
self.assertIn('ATL_ASAP_CLAIMS', environ)
6363

64-
def test_request_with_duplicate_jti_is_accepted_as_per_setting(self):
64+
def test_request_with_duplicate_jti_is_rejected_as_per_setting(self):
6565
self.config['ASAP_CHECK_JTI_UNIQUENESS'] = True
6666
token = create_token(
6767
'client-app', 'server-app',

atlassian_jwt_auth/signer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ def can_reuse_token(self, existing_token, claims):
114114
return False
115115
if set(claims.keys()) != set(existing_claims.keys()):
116116
return False
117-
for key, val in claims.items():
118-
if key in ['exp', 'iat', 'jti', 'nbf']:
117+
for dict_key, val in claims.items():
118+
if dict_key in ['exp', 'iat', 'jti', 'nbf']:
119119
continue
120-
if existing_claims[key] != val:
120+
if existing_claims[dict_key] != val:
121121
return False
122122
return True
123123

atlassian_jwt_auth/tests/test_key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TestKeyModule(unittest.TestCase):
99

1010
def test_key_identifier_with_invalid_keys(self):
1111
""" test that invalid key identifiers are not permitted. """
12-
keys = ['../aha', '/a', '\c:a', 'lk2j34/#$', 'a../../a', 'a/;a',
12+
keys = ['../aha', '/a', r'\c:a', 'lk2j34/#$', 'a../../a', 'a/;a',
1313
' ', ' / ', ' /',
1414
u'dir/some\0thing', 'a/#a', 'a/a?x', 'a/a;',
1515
]

atlassian_jwt_auth/tests/test_public_key_provider.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ def test_https_public_key_retriever_does_not_support_http_url(self):
3030
base urls.
3131
"""
3232
with self.assertRaises(ValueError):
33-
retriever = self.create_retriever('http://example.com')
33+
self.create_retriever('http://example.com')
3434

3535
def test_https_public_key_retriever_does_not_support_none_url(self):
3636
""" tests that HTTPSPublicKeyRetriever does not support None
3737
base urls.
3838
"""
3939
with self.assertRaises(ValueError):
40-
retriever = self.create_retriever(None)
40+
self.create_retriever(None)
4141

4242
def test_https_public_key_retriever_supports_https_url(self):
4343
""" tests that HTTPSPublicKeyRetriever supports https://
4444
base urls.
4545
"""
46-
retriever = self.create_retriever(self.base_url)
46+
self.create_retriever(self.base_url)
4747

4848
@mock.patch.object(requests.Session, 'get')
4949
def test_retrieve(self, mock_get_method):

0 commit comments

Comments
 (0)