mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-31 21:49:45 +00:00
fix(datasets): improve get_safe_version raise (#4263)
* fix: Pass the required response argument to RevisionNotFoundError * chore(dataset): get_safe_version raise --------- Co-authored-by: Harshal Janjani <harshaljanjani@gmail.com>
This commit is contained in:
@@ -180,3 +180,20 @@ def test_non_dict_passthrough_last_wins():
|
||||
out = combine_feature_dicts(g1, g2)
|
||||
# For non-dict entries the last one wins
|
||||
assert out["misc"] == 456
|
||||
|
||||
|
||||
def test_get_safe_version_raises_on_repo_without_version_tags(monkeypatch):
|
||||
monkeypatch.setattr(dataset_utils, "get_repo_versions", Mock(return_value=[]))
|
||||
|
||||
with pytest.raises(RuntimeError, match="must be tagged with a codebase version"):
|
||||
get_safe_version("private/repo", "v3.0")
|
||||
|
||||
|
||||
def test_get_safe_version_error_reports_repo_id(monkeypatch):
|
||||
repo_id = "private/repo"
|
||||
monkeypatch.setattr(dataset_utils, "get_repo_versions", Mock(return_value=[]))
|
||||
|
||||
with pytest.raises(RuntimeError) as exc_info:
|
||||
get_safe_version(repo_id, "v3.0")
|
||||
|
||||
assert repo_id in str(exc_info.value)
|
||||
|
||||
Reference in New Issue
Block a user