danish-dynaword / tests /test_load.py
KennethEnevoldsen's picture
added outlines for more tests
52178ed unverified
raw
history blame
619 Bytes
from pathlib import Path
from datasets import load_dataset
def test_dataset_loads():
"""Ensures that the dataset can load as intended"""
repo = Path(__file__).parent.parent
name = str(repo.resolve())
ds = load_dataset(name, split="train", streaming=True)
sample = next(iter(ds))
assert isinstance(sample, dict)
# def test_all_datasets_in_yaml(repo_path: Path, readme_yaml_header: dict[str, Any]):
# configs = readme_yaml_header["configs"]
# data_folder = repo_path / "data"
# datasets = data_folder.glob("*")
# for dataset in datasets:
# assert dataset in configs