code: def test_obtain_test_result():
      test_cases = [
          {
              "c0": {0: "passed"},
          },
          {
              "c0": {0: "passed", 1: "passed"},
              "c1": {0: "hard_failed", 1: "hard_failed"},
          },
      ]
  
      def _mock_check_output(input: List[str]) -> str:
          commit, run = tuple(input[-1].split("-"))
          return bytes(test_case[commit][int(run)], "utf-8")
  
      for test_case in test_cases:
          with mock.patch(
              "subprocess.check_output",
              side_effect=_mock_check_output,
          ):
              commits = set(test_case.keys())
              rerun_per_commit = len(test_case[list(commits)[0]])
              _obtain_test_result(
                  commits, rerun_per_commit
              ) == test_case
  
file_path: ray/release/ray_release/tests/test_bisect.py
imports: import sys
  import pytest
  from unittest import mock
  from typing import List, Dict
  from ray_release.scripts.ray_bisect import _bisect, _obtain_test_result, _sanity_check, _get_test
label_desc: Use image node_id 2 for calling a global function with example usage: test_obtain_test_result() and returns: bytes