From ea3b53f8a8412f61f350150c642ad819cfb3442e Mon Sep 17 00:00:00 2001 From: Francisco Aranda Date: Thu, 27 Jun 2024 17:58:27 +0200 Subject: [PATCH] tests: Add a new tests --- argilla/tests/unit/test_resources/test_responses.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/argilla/tests/unit/test_resources/test_responses.py b/argilla/tests/unit/test_resources/test_responses.py index 947774acdb..9fb3f3fc06 100644 --- a/argilla/tests/unit/test_resources/test_responses.py +++ b/argilla/tests/unit/test_resources/test_responses.py @@ -16,7 +16,8 @@ import pytest -from argilla import UserResponse, Response +from argilla import UserResponse, Response, Dataset +from argilla._models import UserResponseModel, ResponseStatus class TestResponses: @@ -85,3 +86,10 @@ def test_create_user_response_with_multiple_user_id(self): Response(question_name="other-question", value="answer", user_id=other_user_id), ], ) + + def test_create_user_response_from_draft_response_model_without_values(self): + model = UserResponseModel(values={}, status=ResponseStatus.draft, user=uuid.uuid4()) + response = UserResponse.from_model(model=model, dataset=Dataset(name="burr")) + assert len(response.answers) == 0 + assert response.user_id is None + assert response.status == ResponseStatus.draft