dance-classifier / tests /test_datasets.py
waidhoferj's picture
Refactor config style and reorganize files
557fb53
raw
history blame contribute delete
535 Bytes
from utils import set_path
import pytest
set_path()
from preprocessing.dataset import PipelinedDataset, BestBallroomDataset, SongDataset
import numpy as np
def test_preprocess_dataset():
dataset = BestBallroomDataset()
dataset = PipelinedDataset(dataset, lambda x: x * 0.0)
assert isinstance(dataset._data.song_dataset, SongDataset)
assert hasattr(dataset, "feature_extractor")
features, _ = dataset[0]
assert np.unique(features.numpy())[0] == 0.0
with pytest.raises(AttributeError):
dataset.foo