code: def test_assign_workspaces(
      mock_check_user,
      mock_workspace_factory,
      mock_assignments,
      assignment_type,
      expected_result,
  ):
      with patch(
          "argilla.client.feedback.utils.assignment.check_user",
          side_effect=mock_check_user,
      ):
          with patch(
              "argilla.client.feedback.utils.assignment.User.from_id",
              side_effect=lambda user_id: Mock(
                  username=user_id.split("_")[0]
              ),
          ):
              with patch(
                  "argilla.client.feedback.utils.assignment.check_workspace",
                  side_effect=mock_workspace_factory,
              ):
                  result = assign_workspaces(
                      mock_assignments, assignment_type
                  )
                  assert result == expected_result
  
file_path: argilla/tests/unit/client/feedback/utils/test_assignment.py
imports: import warnings
  from unittest.mock import Mock, patch
  import pytest
  from argilla.client.feedback.utils.assignment import assign_records, assign_records_to_groups, assign_records_to_individuals, assign_workspaces, check_user, check_workspace
  from argilla.client.users import User
  from argilla.client.workspaces import Workspace
label_desc: Use image node_id 10 for calling a global function with example usage: test_assign_workspaces(mock_check_user, mock_workspace_factory, mock_assignments, assignment_type, expected_result) without return types