code: def test_ray_commit_injection(self):
      # Should not be injected if no pip and conda.
      result = RuntimeEnv(env_vars={"hi": "hi"})
      assert "_ray_commit" not in result
  
      # Should be injected if pip or conda present.
      result = RuntimeEnv(pip=["requests"])
      assert "_ray_commit" in result
  
      result = RuntimeEnv(conda="env_name")
      assert "_ray_commit" in result
  
      # Should not override if passed.
      result = RuntimeEnv(conda="env_name", _ray_commit="Blah")
      assert result["_ray_commit"] == "Blah"
  
imports: import os
  import pytest
  import sys
  import tempfile
  from pathlib import Path
  from ray import job_config
  import yaml
  import jsonschema
  from ray._private.runtime_env.validation import parse_and_validate_excludes, parse_and_validate_working_dir, parse_and_validate_conda, parse_and_validate_pip, parse_and_validate_env_vars, parse_and_validate_py_modules
  from ray._private.runtime_env.plugin_schema_manager import RuntimeEnvPluginSchemaManager
  from ray.runtime_env import RuntimeEnv
label_desc: Use image node_id 4 for calling the TestParsedRuntimeEnv obj's underlying member method code with example usage: obj.test_ray_commit_injection() without return types