docstr: Regression test for #1313.
  See https://github.com/huggingface/huggingface_hub/issues/1313.
docstr_tok: ["Regression","test","for","#","1313",".","See","https",":","\/\/github.com\/huggingface\/huggingface_hub\/issues\/1313","."]
code: def test_from_pretrained_model_id_and_revision(
      self, from_pretrained_mock: Mock
  ) -> None:
      """Regression test for #1313.
      See https://github.com/huggingface/huggingface_hub/issues/1313."""
      model = DummyModel.from_pretrained(
          "namespace/repo_name", revision="123456789"
      )
      from_pretrained_mock.assert_called_once_with(
          model_id="namespace/repo_name",
          revision="123456789",  # Revision is passed correctly!
          cache_dir=None,
          force_download=False,
          proxies=None,
          resume_download=False,
          local_files_only=False,
          token=None,
      )
      self.assertIs(model, from_pretrained_mock.return_value)
  
imports: import json
  import os
  import unittest
  from pathlib import Path
  from typing import TypeVar
  from unittest.mock import Mock, patch
  import pytest
  from huggingface_hub import HfApi, hf_hub_download
  from huggingface_hub.hub_mixin import PyTorchModelHubMixin
  from huggingface_hub.utils import SoftTemporaryDirectory, is_torch_available
  from .testing_constants import ENDPOINT_STAGING, TOKEN, USER
  from .testing_utils import repo_name
label_desc: Use image node_id 6 for calling the HubMixingTest obj's underlying member method code with example usage: obj.test_from_pretrained_model_id_and_revision(from_pretrained_mock) without return types