Commit a8a94e9c authored by ale's avatar ale

Add tests for signing invalid tickets (Python)

parent bac5d7dd
......@@ -19,6 +19,7 @@ class SignerTest(unittest.TestCase):
self._signok(sso.Ticket('user', 'service', 'domain'))
def test_sign_ticket_with_ttl(self):
# This is the _old_ constructor syntax.
self._signok(sso.Ticket('user', 'service', 'domain', 3600))
def test_sign_ticket_with_groups(self):
......@@ -29,9 +30,13 @@ class SignerTest(unittest.TestCase):
groups = set(['group1', 'group2'])
self._signok(sso.Ticket('user', 'service', 'domain', groups, 3600))
#def test_sign_fail_with_empty_ticket(self):
# tkt = sso.Ticket()
# self.assertRaises(sso.Error, self.s.sign, tkt)
def test_sign_fail_with_empty_ticket(self):
tkt = sso.Ticket()
self.assertRaises(sso.Error, self.s.sign, tkt)
def test_sign_fail_with_invalid_ticket(self):
tkt = sso.Ticket('|', 'service', 'domain')
self.assertRaises(sso.Error, self.s.sign, tkt)
if __name__ == '__main__':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment