Unverified Commit af506fd7 authored by Harry Mellor's avatar Harry Mellor Committed by GitHub
Browse files

Fix instantiation of `HfHubHTTPError` in LoRA test (#30768)


Signed-off-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
parent ce12b407
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
from collections import OrderedDict from collections import OrderedDict
from typing import NamedTuple from typing import NamedTuple
from unittest.mock import patch from unittest.mock import MagicMock, patch
import pytest import pytest
from huggingface_hub.utils import HfHubHTTPError from huggingface_hub.utils import HfHubHTTPError
...@@ -194,5 +194,8 @@ def test_get_adapter_absolute_path_huggingface_error( ...@@ -194,5 +194,8 @@ def test_get_adapter_absolute_path_huggingface_error(
# Hugging Face model identifier with download error # Hugging Face model identifier with download error
path = "org/repo" path = "org/repo"
mock_exist.return_value = False mock_exist.return_value = False
mock_snapshot_download.side_effect = HfHubHTTPError("failed to query model info") mock_snapshot_download.side_effect = HfHubHTTPError(
"failed to query model info",
response=MagicMock(),
)
assert get_adapter_absolute_path(path) == path assert get_adapter_absolute_path(path) == path
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment