def test_create_update(self, artifactory): user_name = 'test_create_update_user' # Remove if user exist test_user = artifactory.find_user(user_name) if test_user is not None: test_user.delete() test_user = User(artifactory=artifactory, name=user_name, email='*****@*****.**', password='******') # CREATE test_user.create() assert artifactory.find_user(user_name) is not None # UPDATE test_user = artifactory.find_user(user_name) # type: User test_user.password = '******' current_pwd = test_user.encryptedPassword test_user.password = '******' test_user.update() new_pwd = test_user.encryptedPassword assert new_pwd != current_pwd, "Password did not change!" # DELETE test_user.delete() assert artifactory.find_user(user_name) is None
def test_create_delete(self, artifactory): user_name = 'test_create_delete_user' # Remove if user exist test_user = artifactory.find_user(user_name) if test_user is not None: test_user.delete() test_user = User(artifactory=artifactory, name=user_name, email='*****@*****.**', password='******') # CREATE test_user.create() assert artifactory.find_user(user_name) is not None # DELETE test_user.delete() assert artifactory.find_user(user_name) is None
def test_create_delete(self, artifactory): user_name = "test_create_delete_user" # Remove if user exist test_user = artifactory.find_user(user_name) if test_user is not None: test_user.delete() test_user = User( artifactory=artifactory, name=user_name, email="*****@*****.**", password="******", profile_updatable=True, ) # CREATE test_user.create() assert artifactory.find_user(user_name) is not None # DELETE test_user.delete() assert artifactory.find_user(user_name) is None
def find_user(self, name): obj = User(self, name, email="", password=None) if obj.read(): return obj return None