def test_create_delete(self, artifactory): name = 'create_delete_permission' # Remove if exist test_permission = artifactory.find_permission_target(name) if test_permission is not None: test_permission.delete() test_permission = PermissionTarget(artifactory=artifactory, name=name) # CREATE test_permission.create() assert artifactory.find_permission_target(name) is not None # DELETE test_permission.delete() assert artifactory.find_permission_target(name) is None
def find_permission_target(self, name): obj = PermissionTarget(self, name) if obj.read(): return obj return None