code: def test_update_envs():
      with unittest.mock.patch.dict(os.environ):
          env_vars = {
              "PATH": "/test/lib/path:${PATH}",
              "LD_LIBRARY_PATH": "/test/path1:${LD_LIBRARY_PATH}:./test/path2",
              "DYLD_LIBRARY_PATH": "${DYLD_LIBRARY_PATH}:/test/path",
              "LD_PRELOAD": "",
          }
          old_path = os.environ["PATH"]
          os.environ["LD_LIBRARY_PATH"] = "./"
          os.environ["DYLD_LIBRARY_PATH"] = "/lib64"
          os.environ["LD_PRELOAD"] = "/lib:/usr/local/lib"
          update_envs(env_vars)
          assert os.environ["PATH"] == "/test/lib/path:" + old_path
          assert (
              os.environ["LD_LIBRARY_PATH"]
              == "/test/path1:./:./test/path2"
          )
          assert os.environ["DYLD_LIBRARY_PATH"] == "/lib64:/test/path"
          assert os.environ["LD_PRELOAD"] == env_vars["LD_PRELOAD"]
  
          # Test the empty string scenario
          os.environ["LD_LIBRARY_PATH"] = ""
          del os.environ["DYLD_LIBRARY_PATH"]
          del os.environ["LD_PRELOAD"]
          update_envs(env_vars)
          assert (
              os.environ["LD_LIBRARY_PATH"]
              == "/test/path1::./test/path2"
          )
          assert os.environ["DYLD_LIBRARY_PATH"] == ":/test/path"
          assert os.environ["LD_PRELOAD"] == env_vars["LD_PRELOAD"]
  
imports: import os
  import pytest
  import unittest
  import ray
  from ray._private.utils import update_envs
label_desc: Use image node_id 2 for calling a global function with example usage: test_update_envs() without return types