code: def test_cache_state_is_success(
      dataset: str,
      config: Optional[str],
      split: Optional[str],
      cache_kind: str,
  ) -> None:
      assert not CacheState(
          dataset=dataset,
          config=config,
          split=split,
          cache_kind=cache_kind,
          cache_entries_df=get_cache_entries_df(dataset=dataset),
          job_runner_version=JOB_RUNNER_VERSION,
      ).is_success
      upsert_response(
          kind=cache_kind,
          dataset=dataset,
          config=config,
          split=split,
          content={},
          http_status=HTTPStatus.OK,
          dataset_git_revision=REVISION_NAME,
      )
      assert CacheState(
          dataset=dataset,
          config=config,
          split=split,
          cache_kind=cache_kind,
          cache_entries_df=get_cache_entries_df(dataset=dataset),
          job_runner_version=JOB_RUNNER_VERSION,
      ).is_success
      upsert_response(
          kind=cache_kind,
          dataset=dataset,
          config=config,
          split=split,
          content={},
          http_status=HTTPStatus.INTERNAL_SERVER_ERROR,
          dataset_git_revision=REVISION_NAME,
      )
      assert not CacheState(
          dataset=dataset,
          config=config,
          split=split,
          cache_kind=cache_kind,
          cache_entries_df=get_cache_entries_df(dataset=dataset),
          job_runner_version=JOB_RUNNER_VERSION,
      ).is_success
      delete_response(
          kind=cache_kind, dataset=dataset, config=config, split=split
      )
      assert not CacheState(
          dataset=dataset,
          config=config,
          split=split,
          cache_kind=cache_kind,
          cache_entries_df=get_cache_entries_df(dataset=dataset),
          job_runner_version=JOB_RUNNER_VERSION,
      ).is_success
  
file_path: datasets-server/libs/libcommon/tests/test_state.py
imports: from http import HTTPStatus
  from typing import Optional
  import pytest
  from libcommon.queue import Queue
  from libcommon.resources import CacheMongoResource, QueueMongoResource
  from libcommon.simple_cache import delete_response, get_cache_entries_df, upsert_response
  from libcommon.state import ArtifactState, CacheState, ConfigState, DatasetState, SplitState
  from .utils import CACHE_KIND, CONFIG_NAME_1, CONFIG_NAMES, CONFIG_NAMES_CONTENT, DATASET_NAME, JOB_RUNNER_VERSION, PROCESSING_GRAPH, REVISION_NAME, SPLIT_NAME_1, SPLIT_NAMES, SPLIT_NAMES_CONTENT, STEP_CONFIG_B
label_desc: Use image node_id 4 for calling a global function with example usage: test_cache_state_is_success(dataset, config, split, cache_kind) without return types