Ejemplo n.º 1
0
def test_load_metadata():
    data_home = 'tests/resources/mir_datasets/RWC-Jazz'
    metadata = rwc_jazz._load_metadata(data_home)
    assert metadata['data_home'] == data_home
    assert metadata['RM-J004'] == {
        'piece_number': 'No. 4',
        'suffix': 'M01',
        'track_number': 'Tr. 04',
        'title': 'Crescent Serenade (Piano Solo)',
        'artist': 'Makoto Nakamura',
        'duration': 167,
        'variation': 'Instrumentation 1',
        'instruments': 'Pf',
    }
    assert metadata['RM-J044'] == {
        'piece_number': 'No. 44',
        'suffix': 'M04',
        'track_number': 'Tr. 09',
        'title': 'Joyful, Joyful, We Adore Thee',
        'artist': 'K’s Band',
        'duration': 270,
        'variation': 'Style (Free jazz)',
        'instruments': 'Pf & Bs & Dr & Gt & Ts & Fl & Bar',
    }

    metadata_none = rwc_jazz._load_metadata('asdf/asdf')
    assert metadata_none is None
Ejemplo n.º 2
0
def test_load_metadata():
    data_home = 'tests/resources/mir_datasets/RWC-Jazz'
    metadata = rwc_jazz._load_metadata(data_home)
    assert metadata['data_home'] == data_home
    assert metadata['RM-J004'] == {
        'piece_number': 'No. 4',
        'suffix': 'M01',
        'track_number': 'Tr. 04',
        'title': 'Crescent Serenade (Piano Solo)',
        'artist': 'Makoto Nakamura',
        'duration_sec': '02:47',
        'variation': 'Instrumentation 1',
        'instruments': 'Pf',
    }

    metadata_none = rwc_jazz._load_metadata('asdf/asdf')
    assert metadata_none is None