def test_update_location_on_photo():
    temporary_folder, folder = helper.create_working_folder()
    temporary_folder_destination, folder_destination = helper.create_working_folder()

    origin = '%s/plain.jpg' % folder
    shutil.copyfile(helper.get_file('plain.jpg'), origin)

    photo = Photo(origin)
    metadata = photo.get_metadata()

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

    photo_processed = Photo(origin)
    metadata_processed = photo_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.36883), 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_photo/original