code: def test_config_state_as_dict() -> None:
      dataset = DATASET_NAME
      revision = REVISION_NAME
      config = CONFIG_NAME_1
      expected_config_processing_step_name = STEP_CONFIG_B
      processing_step = PROCESSING_GRAPH.get_processing_step(
          expected_config_processing_step_name
      )
  
      upsert_response(
          kind=processing_step.cache_kind,
          dataset=dataset,
          config=config,
          split=None,
          content=SPLIT_NAMES_CONTENT,
          http_status=HTTPStatus.OK,
          dataset_git_revision=REVISION_NAME,
      )
      config_state = ConfigState(
          dataset=dataset,
          revision=revision,
          config=config,
          processing_graph=PROCESSING_GRAPH,
          pending_jobs_df=Queue()._get_df(jobs=[]),
          cache_entries_df=get_cache_entries_df(dataset=dataset),
      )
  
      assert config_state.dataset == dataset
      assert config_state.revision == revision
      assert config_state.config == config
  
      assert len(config_state.artifact_state_by_step) == 1
      assert (
          expected_config_processing_step_name
          in config_state.artifact_state_by_step
      )
      artifact_state = config_state.artifact_state_by_step[
          expected_config_processing_step_name
      ]
      assert (
          artifact_state.id
          == f"{expected_config_processing_step_name},{dataset},{revision},{config}"
      )
      assert artifact_state.cache_state.exists  # <- in the cache
      assert artifact_state.cache_state.is_success  # <- is a success
      assert not artifact_state.job_state.is_in_process
  
      assert config_state.split_names == SPLIT_NAMES
      assert len(config_state.split_states) == len(SPLIT_NAMES)
      assert config_state.split_states[0].split == SPLIT_NAMES[0]
      assert config_state.split_states[1].split == SPLIT_NAMES[1]
  
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 7 for calling a global function with example usage: test_config_state_as_dict() without return types