Commits

Ronny Pfannschmidt committed 7b4591e

split jws tests from app tests

  • Participants
  • Parent commits ae59eb6

Comments (0)

Files changed (1)

     res = persona.b64udecode(middle)
     assert res == input
 
+def test_jws():
+    jws = persona.sign({'foo': 'bar'}, persona.KEY)
+    assert persona.validate(jws, persona.KEY)
+
+    parts = jws.split('.')
+    parts[1] = persona.b64uencode(json.dumps({'bar': 'foo'}))
+    fake = '.'.join(parts)
+    assert not persona.validate(fake, persona.KEY)
 
 class IdPTests(unittest.TestCase):
 	
 		persona.KEY = KEY
 		persona.SECRETS = SECRETS
 	
-	
-	def test_jws(self):
-		
-		jws = persona.sign({'foo': 'bar'}, persona.KEY)
-		assert persona.validate(jws, persona.KEY)
-		
-		parts = jws.split('.')
-		parts[1] = persona.b64uencode(json.dumps({'bar': 'foo'}))
-		fake = '.'.join(parts)
-		assert not persona.validate(fake, persona.KEY)
-	
 	def test_verify(self):
 		
 		totp = persona.totp(SECRETS['me']['totp']).pop()