code: def test_download_webfile(
      static_files_server, util, url, expected_result
  ):
      filename = os.path.join(
          util.TMP_DIR, "moviepy_downloader_test.mp4"
      )
      if os.path.isfile(filename):
          try:
              os.remove(filename)
          except PermissionError:
              pass
  
      if hasattr(expected_result, "__traceback__") or len(url) == 11:
          if not shutil.which("youtube-dl"):
              with pytest.raises(expected_result):
                  download_webfile(url, filename)
              assert not os.path.isfile(filename)
          elif len(url) != 11:
              with pytest.raises(OSError) as exc:
                  download_webfile(url, filename)
              assert "Error running youtube-dl." in str(exc.value)
              assert not os.path.isfile(filename)
          else:
              download_webfile(url, filename)
              assert os.path.isfile(filename)
      else:
          # network files
          with static_files_server():
              download_webfile(url, filename)
  
          assert filecmp.cmp(filename, expected_result)
  
      if os.path.isfile(filename):
          try:
              os.remove(filename)
          except PermissionError:
              pass
  
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 7 for calling a global function with example usage: test_download_webfile(static_files_server, util, url, expected_result) without return types