File size: 601 Bytes
fd357f4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | import os
import pytest
from integrations.huggingface_client import HuggingFaceClient
@pytest.mark.parametrize(
"path,expected",
[
("/.cache/model.safetensors", None),
("/home/user/.local/file.bin", None),
("data/experiments/run1/model.bin", "model.bin"),
("tmp/something/file.parquet", "file.parquet"),
("models/checkpoint-1/weights.safetensors", "models/checkpoint-1/weights.safetensors"),
],
)
def test_clean_repo_path(path, expected):
client = HuggingFaceClient(repo_id="dummy/repo")
assert client._clean_repo_path(path) == expected
|