code: def test_execswitch(tmpdir):
      context = CX(root=tmpdir, execution_phase=ExecutionPhase.TRAIN)
      data_inputs = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
  
      phase_to_step = {
          p: SomeStep()
          for p in (
              ExecutionPhase.PRETRAIN,
              ExecutionPhase.TRAIN,
              ExecutionPhase.TEST,
          )
      }
      p = ExecutionPhaseSwitch(phase_to_step)
      p_c = p.with_context(context)
  
      p_c.fit_transform(data_inputs)
      assert phase_to_step[ExecutionPhase.PRETRAIN].did_process is False
      assert phase_to_step[ExecutionPhase.TRAIN].did_process is True
      assert phase_to_step[ExecutionPhase.TEST].did_process is False
  
      p_c = p.with_context(
          context.set_execution_phase(ExecutionPhase.UNSPECIFIED)
      )
      with pytest.raises(KeyError) as error_info:
          p_c.fit_transform(data_inputs)
  
file_path: Neuraxle/testing_neuraxle/steps/test_if_execution_phase_is_then_do.py
imports: import numpy
  import pytest
  from pytest import skip
  from neuraxle.base import CX, ExecutionPhase
  from neuraxle.data_container import DataContainer
  from neuraxle.steps.flow import IfExecutionPhaseIsThen, ExecutionPhaseSwitch
  from testing_neuraxle.test_forcehandle_mixin import ForceHandleIdentity
label_desc: Use image node_id 5 for calling a global function with example usage: test_execswitch(tmpdir) without return types