Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ce3e84e

Browse files
committedMar 18, 2015
Merge pull request #112 from mark-adams/fix-flaky-test
Fixed a flaky test for EC validation that would fail on OS X
2 parents 201e4b1 + ce65da1 commit ce3e84e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎tests/test_algorithms.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,12 @@ def test_ec_verify_should_return_false_if_signature_invalid(self):
171171

172172
jwt_message = ensure_bytes('Hello World!')
173173

174+
# Mess up the signature by replacing a known byte
174175
jwt_sig = base64.b64decode(ensure_bytes(
175176
'MIGIAkIB9vYz+inBL8aOTA4auYz/zVuig7TT1bQgKROIQX9YpViHkFa4DT5'
176177
'5FuFKn9XzVlk90p6ldEj42DC9YecXHbC2t+cCQgCicY+8f3f/KCNtWK7cif'
177178
'6vdsVwm6Lrjs0Ag6ZqCf+olN11hVt1qKBC4lXppqB1gNWEmNQaiz1z2QRyc'
178-
'zJ8hSJmbw=='))
179-
180-
jwt_sig += ensure_bytes('123') # Signature is now invalid
179+
'zJ8hSJmbw=='.replace('r', 's')))
181180

182181
with open(key_path('testkey_ec.pub'), 'r') as keyfile:
183182
jwt_pub_key = algo.prepare_key(keyfile.read())

0 commit comments

Comments
 (0)
Please sign in to comment.