Skip to content

Commit

Permalink
tests: Add a new tests
Browse files Browse the repository at this point in the history
  • Loading branch information
frascuchon committed Jun 28, 2024
1 parent 1cd5903 commit ea3b53f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion argilla/tests/unit/test_resources/test_responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

0 comments on commit ea3b53f

Please sign in to comment.