code: def test_delete_dataset(mocker: MockerFixture) -> None:
      mocker.patch.object(
          ApiWorkflowClient, "__init__", return_value=None
      )
      mock_datasets_api = mocker.MagicMock()
      client = ApiWorkflowClient()
      client._dataset_id = "foo"
      client._datasets_api = mock_datasets_api
      client.delete_dataset_by_id("foobar")
      mock_datasets_api.delete_dataset_by_id.assert_called_once_with(
          dataset_id="foobar"
      )
      assert not hasattr(client, "_dataset_id")
  
imports: from typing import List
  import pytest
  from pytest_mock import MockerFixture
  from lightly.api import ApiWorkflowClient, api_workflow_datasets
  from lightly.openapi_generated.swagger_client.api import DatasetsApi
  from lightly.openapi_generated.swagger_client.models import Creator, DatasetCreateRequest, DatasetData, DatasetType
  from lightly.openapi_generated.swagger_client.rest import ApiException
  from tests.api_workflow import utils
  from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup
label_desc: Use image node_id 8 for calling a global function with example usage: test_delete_dataset(mocker) without return types