MCPcopy
hub / github.com/kserve/kserve / test_explicit_patterns_override_env

Function test_explicit_patterns_override_env

python/storage/test/test_hf_storage.py:119–129  ·  view source on GitHub ↗
(mock_snapshot_download)

Source from the content-addressed store, hash-verified

117
118@mock.patch("huggingface_hub.snapshot_download")
119def test_explicit_patterns_override_env(mock_snapshot_download):
120 uri = "hf://example.com/model"
121
122 with mock.patch.dict(
123 os.environ,
124 {"STORAGE_ALLOW_PATTERNS": '["*.bin"]'},
125 ):
126 Storage.download(uri, out_dir="/tmp/out", allow_patterns=["*.safetensors"])
127
128 call_kwargs = mock_snapshot_download.call_args[1]
129 assert call_kwargs.get("allow_patterns") == ["*.safetensors"]
130
131
132@mock.patch("huggingface_hub.snapshot_download")

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
downloadMethod · 0.45

Tested by

no test coverage detected