Esempio n. 1
0
    def test_existingUser(self):
        user = RestAuthUser.create(self.conn, username)

        try:
            RestAuthUser.create_test(self.conn, username)
            self.fail()
        except UserExists:
            self.assertEqual([user], RestAuthUser.get_all(self.conn))
        finally:
            user.remove()
Esempio n. 2
0
 def test_createUserTestWithInvalidUsername(self):
     try:
         RestAuthUser.create_test(self.conn, "foo/bar")
         self.fail()
     except error.PreconditionFailed:
         self.assertEqual([], RestAuthUser.get_all(self.conn))
Esempio n. 3
0
 def test_createUserTestWithTooShortPassword(self):
     try:
         RestAuthUser.create_test(self.conn, username, "x")
         self.fail()
     except error.PreconditionFailed:
         self.assertEqual([], RestAuthUser.get_all(self.conn))
Esempio n. 4
0
 def test_createUserTestWithPasswordAndProperties(self):
     self.assertEquals(None, RestAuthUser.create_test(self.conn, username, "password", properties={"foo": "bar"}))
     self.assertEqual([], RestAuthUser.get_all(self.conn))
Esempio n. 5
0
 def test_createUserTestWithPassword(self):
     self.assertEquals(None, RestAuthUser.create_test(self.conn, username, "password"))
     self.assertEqual([], RestAuthUser.get_all(self.conn))
Esempio n. 6
0
 def test_createUserTest(self):
     self.assertEquals(None, RestAuthUser.create_test(self.conn, username))
     self.assertEqual([], RestAuthUser.get_all(self.conn))