Spaces:
Runtime error
Runtime error
File size: 535 Bytes
557fb53 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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
|