Exemplo n.º 1
0
def test_get_preferences_dir():
    assert config.get_preferences_dir() == path.join(config.get_home_dir(),
                                                     'Library/Preferences/')
Exemplo n.º 2
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)
Exemplo n.º 3
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())
Exemplo n.º 4
0
def backup():
    print 'Backing up preferences (.plist)...'
    source = get_preferences_dir()
    dest = get_preferences_backup_dir()
    copy_dir(source, dest)
Exemplo n.º 5
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())
Exemplo n.º 6
0
def backup():
    log.info('Backing up preferences (.plist)...')
    source = get_preferences_dir()
    dest = get_preferences_backup_dir()
    copy_dir(source, dest)