code: def test_check_workspace(
      mock_create,
      mock_from_name,
      mock_workspace,
      workspace_name,
      workspace_exists,
  ):
      if workspace_exists:
          mock_from_name.return_value = mock_workspace
          mock_from_name.side_effect = None
      else:
          mock_from_name.side_effect = ValueError(
              "Workspace does not exist."
          )
          mock_create.return_value = mock_workspace
  
      result = check_workspace(workspace_name)
  
      assert result is mock_workspace
      if workspace_exists:
          mock_from_name.assert_called_with(workspace_name)
      else:
          mock_create.assert_called_with(workspace_name)
  
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 6 for calling a global function with example usage: test_check_workspace(mock_create, mock_from_name, mock_workspace, workspace_name, workspace_exists) without return types