Skip to content

Commit

Permalink
Merge pull request #112 from mark-adams/fix-flaky-test
Browse files Browse the repository at this point in the history
Fixed a flaky test for EC validation that would fail on OS X
  • Loading branch information
jpadilla committed Mar 18, 2015
2 parents 201e4b1 + ce65da1 commit ce3e84e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,12 @@ def test_ec_verify_should_return_false_if_signature_invalid(self):

jwt_message = ensure_bytes('Hello World!')

# Mess up the signature by replacing a known byte
jwt_sig = base64.b64decode(ensure_bytes(
'MIGIAkIB9vYz+inBL8aOTA4auYz/zVuig7TT1bQgKROIQX9YpViHkFa4DT5'
'5FuFKn9XzVlk90p6ldEj42DC9YecXHbC2t+cCQgCicY+8f3f/KCNtWK7cif'
'6vdsVwm6Lrjs0Ag6ZqCf+olN11hVt1qKBC4lXppqB1gNWEmNQaiz1z2QRyc'
'zJ8hSJmbw=='))

jwt_sig += ensure_bytes('123') # Signature is now invalid
'zJ8hSJmbw=='.replace('r', 's')))

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

0 comments on commit ce3e84e

Please sign in to comment.