code: def test_download_with_ignored_patterns(self, mock: Mock) -> None:
      args = Namespace(
          token=None,
          repo_id="author/model",
          filenames=["README.md", "config.json"],
          repo_type="model",
          revision=None,
          include=["*.json"],
          exclude=["data/*"],
          force_download=True,
          resume_download=True,
          cache_dir=None,
          quiet=False,
          local_dir=None,
          local_dir_use_symlinks="auto",
      )
  
      with self.assertWarns(UserWarning):
          # warns that patterns are ignored
          DownloadCommand(args).run()
  
      mock.assert_called_once_with(
          repo_id="author/model",
          repo_type="model",
          revision=None,
          allow_patterns=[
              "README.md",
              "config.json",
          ],  # `filenames` has priority over the patterns
          ignore_patterns=None,  # cleaned up
          resume_download=True,
          force_download=True,
          cache_dir=None,
          token=None,
          local_dir=None,
          local_dir_use_symlinks="auto",
          library_name="huggingface-cli",
      )
  
      # Same but quiet (no warnings)
      args.quiet = True
      with warnings.catch_warnings():
          # Taken from https://docs.pytest.org/en/latest/how-to/capture-warnings.html#additional-use-cases-of-warnings-in-tests
          warnings.simplefilter("error")
          DownloadCommand(args).run()
  
imports: import os
  import unittest
  import warnings
  from argparse import ArgumentParser, Namespace
  from contextlib import contextmanager
  from pathlib import Path
  from typing import Generator
  from unittest.mock import Mock, patch
  from huggingface_hub.commands.delete_cache import DeleteCacheCommand
  from huggingface_hub.commands.download import DownloadCommand
  from huggingface_hub.commands.scan_cache import ScanCacheCommand
  from huggingface_hub.commands.upload import UploadCommand
  from huggingface_hub.utils import RevisionNotFoundError, SoftTemporaryDirectory, capture_output
  from .testing_utils import DUMMY_MODEL_ID
label_desc: Use image node_id 7 for calling the TestDownloadCommand obj's underlying member method code with example usage: obj.test_download_with_ignored_patterns(mock) without return types