code: def test_config(
      util,
      ffmpeg_binary,
      ffmpeg_binary_error,
      imagemagick_binary,
      imagemagick_binary_error,
      imagemagick_binary_isfile,
      imagemagick_binary_isdir,
  ):
      if "moviepy.config" in sys.modules:
          del sys.modules["moviepy.config"]
  
      if ffmpeg_binary_error is not None and os.path.isfile(
          ffmpeg_binary
      ):
          os.remove(ffmpeg_binary)
      prev_ffmpeg_binary = os.environ.get("FFMPEG_BINARY")
      os.environ["FFMPEG_BINARY"] = ffmpeg_binary
  
      prev_imagemagick_binary = os.environ.get("IMAGEMAGICK_BINARY")
      if imagemagick_binary_isfile:
          imagemagick_binary = os.path.join(
              util.TMP_DIR, imagemagick_binary
          )
          with open(imagemagick_binary, "w") as f:
              f.write("foo")
      elif imagemagick_binary_isdir:
          imagemagick_binary = os.path.join(
              util.TMP_DIR, imagemagick_binary
          )
          if os.path.isdir(imagemagick_binary):
              shutil.rmtree(imagemagick_binary)
          os.mkdir(imagemagick_binary)
      os.environ["IMAGEMAGICK_BINARY"] = imagemagick_binary
  
      if ffmpeg_binary_error is not None:
          with pytest.raises(ffmpeg_binary_error[0]) as exc:
              importlib.import_module("moviepy.config")
          assert ffmpeg_binary_error[1] in str(exc.value)
      else:
          if imagemagick_binary_error is not None:
              with pytest.raises(imagemagick_binary_error[0]) as exc:
                  importlib.import_module("moviepy.config")
              assert imagemagick_binary_error[1] in str(exc.value)
          else:
              importlib.import_module("moviepy.config")
  
      if prev_ffmpeg_binary is not None:
          os.environ["FFMPEG_BINARY"] = prev_ffmpeg_binary
  
      if prev_imagemagick_binary is not None:
          os.environ["IMAGEMAGICK_BINARY"] = prev_imagemagick_binary
  
      if "moviepy.config" in sys.modules:
          del sys.modules["moviepy.config"]
  
file_path: moviepy/tests/test_tools.py
imports: import contextlib
  import filecmp
  import importlib
  import io
  import os
  import shutil
  import sys
  import pytest
  import moviepy.tools
  from moviepy.video.io.downloader import download_webfile
label_desc: Use image node_id 8 for calling a global function with example usage: test_config(util, ffmpeg_binary, ffmpeg_binary_error, imagemagick_binary, imagemagick_binary_error, imagemagick_binary_isfile, imagemagick_binary_isdir) without return types