Skip to content

Commit

Permalink
Fix test_dataset_info (missing dummy dataset) (#2850)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin authored Feb 12, 2025
1 parent 632c04f commit 0467c1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions tests/test_hf_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2164,20 +2164,17 @@ def test_dataset_info(self):
dataset = self._api.dataset_info(repo_id=DUMMY_DATASET_ID)
assert isinstance(dataset.card_data, DatasetCardData) and len(dataset.card_data) > 0
assert isinstance(dataset.siblings, list) and len(dataset.siblings) > 0
self.assertIsInstance(dataset, DatasetInfo)
self.assertNotEqual(dataset.sha, DUMMY_DATASET_ID_REVISION_ONE_SPECIFIC_COMMIT)
assert isinstance(dataset, DatasetInfo)
assert dataset.sha != DUMMY_DATASET_ID_REVISION_ONE_SPECIFIC_COMMIT
dataset = self._api.dataset_info(
repo_id=DUMMY_DATASET_ID,
revision=DUMMY_DATASET_ID_REVISION_ONE_SPECIFIC_COMMIT,
)
self.assertIsInstance(dataset, DatasetInfo)
self.assertEqual(dataset.sha, DUMMY_DATASET_ID_REVISION_ONE_SPECIFIC_COMMIT)
assert isinstance(dataset, DatasetInfo)
assert dataset.sha == DUMMY_DATASET_ID_REVISION_ONE_SPECIFIC_COMMIT

def test_dataset_info_with_file_metadata(self):
dataset = self._api.dataset_info(
repo_id=SAMPLE_DATASET_IDENTIFIER,
files_metadata=True,
)
dataset = self._api.dataset_info(repo_id=SAMPLE_DATASET_IDENTIFIER, files_metadata=True)
files = dataset.siblings
assert files is not None
self._check_siblings_metadata(files)
Expand Down
4 changes: 2 additions & 2 deletions tests/testing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@

SAMPLE_DATASET_IDENTIFIER = "lhoestq/custom_squad"
# Example dataset ids
DUMMY_DATASET_ID = "lhoestq/test"
DUMMY_DATASET_ID_REVISION_ONE_SPECIFIC_COMMIT = "81d06f998585f8ee10e6e3a2ea47203dc75f2a16" # on branch "test-branch"
DUMMY_DATASET_ID = "gaia-benchmark/GAIA"
DUMMY_DATASET_ID_REVISION_ONE_SPECIFIC_COMMIT = "c603981e170e9e333934a39781d2ae3a2677e81f" # on branch "test-branch"

YES = ("y", "yes", "t", "true", "on", "1")
NO = ("n", "no", "f", "false", "off", "0")
Expand Down

0 comments on commit 0467c1c

Please sign in to comment.