예제 #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")