def test_task__delete_model(task_b: Task, model): task_b.add_model(model) assert model.id is not None assert model.task_id is not None task_b.delete_model(model) assert len(task_b.models) == 0 assert model.id is None assert model.task_id is None
def test_task__delete_model_with_artifacts(task_b: Task, model, artifact_repo): model._unpersisted_artifacts = Blobs({'data': InMemoryBlob(b'data')}) task_b.bind_artifact_repo(artifact_repo) task_b.push_model(model) assert model.id is not None assert model.task_id is not None task_b.delete_model(model) assert len(task_b.models) == 0 assert model.id is None assert model.task_id is None