Beispiel #1
0
 def test_oneTimePad(self):
     """
     L{OneTimePadChecker.requestAvatarId} should invalidate the pad if a
     login is successful.
     """
     PAD = 'test_requestAvatarId'
     checker = OneTimePadChecker({PAD: 'username'})
     checker.requestAvatarId(_AMPOneTimePad(PAD))
     self.assertRaises(UnauthorizedLogin,
                       lambda: checker.requestAvatarId(_AMPOneTimePad(PAD)))
Beispiel #2
0
 def test_oneTimePad(self):
     """
     L{OneTimePadChecker.requestAvatarId} should invalidate the pad if a
     login is successful.
     """
     PAD = 'test_requestAvatarId'
     checker = OneTimePadChecker({PAD: 'username'})
     checker.requestAvatarId(_AMPOneTimePad(PAD))
     self.assertRaises(
         UnauthorizedLogin,
         lambda: checker.requestAvatarId(_AMPOneTimePad(PAD)))
Beispiel #3
0
 def test_requestAvatarIdUnauthorized(self):
     """
     L{OneTimePadChecker.requestAvatarId} should throw L{UnauthorizedLogin}
     if an unknown pad is given.
     """
     checker = OneTimePadChecker({})
     self.assertRaises(
         UnauthorizedLogin,
         lambda: checker.requestAvatarId(_AMPOneTimePad(None)))
Beispiel #4
0
 def test_requestAvatarIdUnauthorized(self):
     """
     L{OneTimePadChecker.requestAvatarId} should throw L{UnauthorizedLogin}
     if an unknown pad is given.
     """
     checker = OneTimePadChecker({})
     self.assertRaises(
         UnauthorizedLogin,
         lambda: checker.requestAvatarId(_AMPOneTimePad(None)))
Beispiel #5
0
 def test_requestAvatarId(self):
     """
     L{OneTimePadChecker.requestAvatarId} should return the username in the
     case the pad is valid.
     """
     PAD = 'test_requestAvatarId'
     USERNAME = '******'
     checker = OneTimePadChecker({PAD: USERNAME})
     self.assertEqual(
         checker.requestAvatarId(_AMPOneTimePad(PAD)), USERNAME)
Beispiel #6
0
 def test_requestAvatarId(self):
     """
     L{OneTimePadChecker.requestAvatarId} should return the username in the
     case the pad is valid.
     """
     PAD = 'test_requestAvatarId'
     USERNAME = '******'
     checker = OneTimePadChecker({PAD: USERNAME})
     self.assertEqual(checker.requestAvatarId(_AMPOneTimePad(PAD)),
                      USERNAME)