def test_save_method_cleans_temp_directory(dietstorage):
    filename = 'stockholm.jpg'
    path = join(THIS_DIR, 'test_files', 'stockholm.jpg')
    tmppath = join(dietstorage.temp_dir, filename)
    new_path = dietstorage.save(path, open(path, 'rb'))
    try:
        assert (not exists(tmppath))
    finally:
        os.remove(new_path)
def test_save_method_cleans_temp_directory(dietstorage):
    filename = 'stockholm.jpg'
    path = join(THIS_DIR, 'test_files', 'stockholm.jpg')
    tmppath = join(dietstorage.temp_dir, filename)
    new_path = dietstorage.save(path, open(path, 'rb'))
    try:
        assert (not exists(tmppath))
    finally:
        os.remove(new_path)