docstr: Try delete a local folder that is protected.
docstr_tok: ["Try","delete","a","local","folder","that","is","protected","."]
code: def test_delete_path_on_local_folder_with_wrong_permission(
      self,
  ) -> None:
      """Try delete a local folder that is protected."""
      dir_path = self.cache_dir / "something"
      dir_path.mkdir()
      file_path_1 = dir_path / "file.txt"  # file at root
      file_path_1.touch()
      dir_path.chmod(444)  # Read-only folder
  
      with self.assertLogs() as captured:
          _try_delete_path(dir_path, path_type="TYPE")
  
      # Folder still exists (couldn't be deleted)
      self.assertTrue(dir_path.is_dir())
  
      # Assert warning message with traceback for debug purposes
      self.assertEqual(len(captured.output), 1)
      self.assertTrue(
          captured.output[0].startswith(
              "WARNING:huggingface_hub.utils._cache_manager:Couldn't delete TYPE:"
              f" permission denied ({dir_path})\nTraceback (most recent call last):"
          )
      )
  
      # For proper cleanup
      dir_path.chmod(509)
  
imports: import os
  import tempfile
  import time
  import unittest
  from pathlib import Path
  from unittest.mock import Mock
  import pytest
  from huggingface_hub._snapshot_download import snapshot_download
  from huggingface_hub.commands.scan_cache import ScanCacheCommand
  from huggingface_hub.utils import DeleteCacheStrategy, HFCacheInfo, capture_output, scan_cache_dir
  from huggingface_hub.utils._cache_manager import CacheNotFound, _format_size, _format_timesince, _try_delete_path
  from .testing_constants import TOKEN
  from .testing_utils import rmtree_with_retry, with_production_testing, xfail_on_windows
label_desc: Use image node_id 5 for calling the TestTryDeletePath obj's underlying member method code with example usage: obj.test_delete_path_on_local_folder_with_wrong_permission() without return types