def test_update_location_on_audio():
    if not can_edit_exif():
        raise SkipTest('avmetareadwrite executable not found')

    temporary_folder, folder = helper.create_working_folder()
    temporary_folder_destination, folder_destination = helper.create_working_folder()

    origin = '%s/audio.m4a' % folder
    shutil.copyfile(helper.get_file('audio.m4a'), origin)

    audio = Audio(origin)
    metadata = audio.get_metadata()

    reset_hash_db()
    status = elodie.update_location(audio, origin, 'Sunnyvale, CA')
    restore_hash_db()

    audio_processed = Audio(origin)
    metadata_processed = audio_processed.get_metadata()

    shutil.rmtree(folder)
    shutil.rmtree(folder_destination)

    assert status == True, status
    assert metadata['latitude'] != metadata_processed['latitude']
    assert helper.isclose(metadata_processed['latitude'], 37.3688305556), metadata_processed['latitude']
    assert helper.isclose(metadata_processed['longitude'], -122.03635), metadata_processed['longitude']
dataset/ETHPy150Open jmathai/elodie/elodie/tests/elodie_test.py/test_update_location_on_audio/original