def testCheckPasswd(self): session = AuthenticatedSession(self.cfg, self.email, passwd=self.passwd) self.assertFalse(session.checkPasswd(self.passwd + "false")) self.assertFalse(session.checkPasswd("")) self.assertTrue(session.checkPasswd(self.passwd)) newPasswd = "new_pass_word" session.setPasswd(newPasswd) self.assertFalse(session.checkPasswd(self.passwd)) self.assertTrue(session.checkPasswd(newPasswd))
def testChangePasswd(self): session = AuthenticatedSession(self.cfg, self.email, passwd=self.passwd) newPasswd = "new_pass_word" self.assertRaises(AuthenticationError, session.changePasswd, self.passwd + "false", newPasswd) session.changePasswd(self.passwd, newPasswd) self.assertTrue(session.checkPasswd(newPasswd))