From 20915858432fef9c5e0afd9925b980f0d53094e1 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Wed, 5 Mar 2025 15:10:29 -0800 Subject: [PATCH] unregister fix --- tests/integration/datasetio/test_datasetio.py | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/tests/integration/datasetio/test_datasetio.py b/tests/integration/datasetio/test_datasetio.py index c63b15f08..5d0e7e37f 100644 --- a/tests/integration/datasetio/test_datasetio.py +++ b/tests/integration/datasetio/test_datasetio.py @@ -9,8 +9,6 @@ import mimetypes import os from pathlib import Path -import pytest - # How to run this test: # # LLAMA_STACK_CONFIG="template-name" pytest -v tests/integration/datasetio @@ -66,34 +64,18 @@ def register_dataset(llama_stack_client, for_generation=False, for_rag=False, da ) -def test_datasets_list(llama_stack_client): - # NOTE: this needs you to ensure that you are starting from a clean state - # but so far we don't have an unregister API unfortunately, so be careful - - response = llama_stack_client.datasets.list() - assert isinstance(response, list) - assert len(response) == 0 - - -def test_register_dataset(llama_stack_client): +def test_register_unregister_dataset(llama_stack_client): register_dataset(llama_stack_client) response = llama_stack_client.datasets.list() assert isinstance(response, list) assert len(response) == 1 assert response[0].identifier == "test_dataset" - with pytest.raises(ValueError): - # unregister a dataset that does not exist - llama_stack_client.datasets.unregister("test_dataset2") - llama_stack_client.datasets.unregister("test_dataset") response = llama_stack_client.datasets.list() assert isinstance(response, list) assert len(response) == 0 - with pytest.raises(ValueError): - llama_stack_client.datasets.unregister("test_dataset") - def test_get_rows_paginated(llama_stack_client): register_dataset(llama_stack_client)