コード例 #1
0
 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))
コード例 #2
0
 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))