Exemple #1
0
 def test_request_avatar_id(self):
     checker = GoUserSessionAccessChecker(self.sm)
     session = {}
     self.sm.set_user_account_key(session, u"user-1")
     yield self.sm.save_session(u"session-1", session, 10)
     creds = UsernamePassword(u"session_id", u"session-1")
     user = yield checker.requestAvatarId(creds)
     self.assertEqual(user, u"user-1")
Exemple #2
0
 def test_request_avatar_id_bad_password(self):
     checker = GoUserSessionAccessChecker(self.sm)
     creds = UsernamePassword(u"session_id", u"session-unknown")
     errored = False
     try:
         yield checker.requestAvatarId(creds)
     except error.UnauthorizedLogin:
         errored = True
     self.assertTrue(errored)
Exemple #3
0
 def test_request_avatar_id_bad_username(self):
     checker = GoUserSessionAccessChecker(self.sm)
     session = {}
     self.sm.set_user_account_key(session, u"user-1")
     yield self.sm.save_session(u"session-1", session, 10)
     creds = UsernamePassword(u"session_id_BAD", u"session-1")
     try:
         yield checker.requestAvatarId(creds)
     except error.UnauthorizedLogin:
         errored = True
     self.assertTrue(errored)