Пример #1
0
def test_backup(copy_dir_mock):
    source = get_preferences_dir()
    dest = get_preferences_backup_dir()
    preferences.backup()
    copy_dir_mock.assert_called_with(source, dest)
Пример #2
0
def test_restore(copy_dir_mock, ensure_mock):
    source = get_preferences_backup_dir()
    dest = get_preferences_dir()
    preferences.restore()
    copy_dir_mock.assert_called_with(source, dest, with_sudo=True)
    ensure_mock.assert_called_with(dest, get_user())
Пример #3
0
def restore():
    print 'Restoring preferences (.plist)...'
    source = get_preferences_backup_dir()
    dest = get_preferences_dir()
    copy_dir(source, dest, with_sudo=True)
    ensure_dir_owned_by_user(dest, get_user())
Пример #4
0
def backup():
    print 'Backing up preferences (.plist)...'
    source = get_preferences_dir()
    dest = get_preferences_backup_dir()
    copy_dir(source, dest)
Пример #5
0
def backup():
    log.info('Backing up preferences (.plist)...')
    source = get_preferences_dir()
    dest = get_preferences_backup_dir()
    copy_dir(source, dest)