def test_save():

    jam = muda.load_jam_audio('data/fixture.jams',
                              'data/fixture.wav')

    _, jamfile = tempfile.mkstemp(suffix='.jams')
    _, audfile = tempfile.mkstemp(suffix='.wav')

    muda.save(audfile, jamfile, jam)

    jam2 = muda.load_jam_audio(jamfile, audfile)
    jam2_raw = jams.load(jamfile)

    os.unlink(audfile)
    os.unlink(jamfile)

    assert hasattr(jam2.sandbox, 'muda')
    assert '_audio' in jam2.sandbox.muda
    assert '_audio' not in jam2_raw.sandbox.muda

    eq_(jam2.file_metadata.duration,
        librosa.get_duration(**jam2.sandbox.muda['_audio']))
dataset/ETHPy150Open bmcfee/muda/tests/test_core.py/test_save/original