コード例 #1
0
 def test_add_user_with_short_password(self):
     with self.assertRaises(PasswordTooShort):
         authenticator.add_user('user_1', 'pwd')
コード例 #2
0
 def test_check_permission_not_permitted_user(self):
     authenticator.add_user('user_2', 'user2pwd')
     authenticator.login('user_2', 'user2pwd')
     with self.assertRaises(NotPermittedError):
         authorizor.check_permission('test', 'user_2')
コード例 #3
0
 def test_add_user(self):
     authenticator.add_user("tim", "struppi")
     self.assertTrue("frank" in authenticator.users)
コード例 #4
0
 def test_add_user_with_same_name(self):
     authenticator.add_user('user', 'usrpwd')
     with self.assertRaises(UsernameAlreadyExist):
         authenticator.add_user('user', 'usrpwd')
コード例 #5
0
 def test_exception_password_too_short(self):
     with self.assertRaises(PasswordTooShort):
         authenticator.add_user("struppi", "tim")
コード例 #6
0
 def test_exception_username_exists(self):
     with self.assertRaises(UsernameAlreadyExists):
         authenticator.add_user('frank', 'number2')
コード例 #7
0
 def setUp(self):
     authenticator.add_user("frank", "thetank")
コード例 #8
0
 def test_add_user(self):
     authenticator.add_user("tim", "struppi")
     self.assertTrue("frank" in authenticator.users)
コード例 #9
0
 def test_exception_username_exists(self):
     with self.assertRaises(UsernameAlreadyExists):
         authenticator.add_user('frank', 'number2')
コード例 #10
0
 def test_exception_password_too_short(self):
     with self.assertRaises(PasswordTooShort):
         authenticator.add_user("struppi", "tim")
コード例 #11
0
 def setUp(self):
     authenticator.add_user("frank", "thetank")