| from urllib.parse import quote | |
| import pytest | |
| from datasets.utils.hub import hf_hub_url | |
| def test_hf_hub_url(repo_id, path, revision): | |
| url = hf_hub_url(repo_id=repo_id, path=path, revision=revision) | |
| assert url == f"https://huggingface.co/datasets/{repo_id}/resolve/{revision or 'main'}/{quote(path)}" | |