code: def test_does_raise_when_incorrect_job_status():
      try:
          job = Mock()
          _check_job_status(
              job,
              {"TransformationJobStatus": "Failed"},
              "TransformationJobStatus",
          )
          assert (
              False
          ), "sagemaker.exceptions.UnexpectedStatusException should have been raised but was not"
      except Exception as e:
          assert (
              type(e) == sagemaker.exceptions.UnexpectedStatusException
          )
          assert e.actual_status == "Failed"
          assert "Completed" in e.allowed_statuses
          assert "Stopped" in e.allowed_statuses
  
file_path: sagemaker-python-sdk/tests/unit/test_exception_on_bad_status.py
imports: from __future__ import absolute_import
  import pytest
  from mock import Mock, MagicMock
  import sagemaker
  from sagemaker.session import _check_job_status
label_desc: Use image node_id 5 for calling a global function with example usage: test_does_raise_when_incorrect_job_status() without return types