Exemple #1
0
def test_from_to():
    module_folder = os.path.dirname(os.path.realpath(__file__))
    test_data_folder = os.path.join(module_folder, 'data', 'duplicity')
    restore_to_public = os.path.join(
        test_data_folder,
        'restore_to_files',
        'public',
    )
    media_folder = os.path.join(test_data_folder, 'media')
    duplicity = Duplicity(get_site_info(), 'files')
    result = duplicity._get_from_to(restore_to_public, media_folder)
    expect = [
        (
            os.path.join(restore_to_public, 'booking'),
            os.path.join(media_folder, 'booking'),
        ),
        (
            os.path.join(restore_to_public, 'compose'),
            os.path.join(media_folder, 'compose'),
        ),
    ]
    assert result == expect
Exemple #2
0
def test_find_sql():
    module_folder = os.path.dirname(os.path.realpath(__file__))
    restore_to = os.path.join(module_folder, 'data', 'duplicity', 'restore_to')
    duplicity = Duplicity(get_site_info(), 'backup')
    assert '20150124_0100.sql' in duplicity._find_sql(restore_to)
Exemple #3
0
def restore(backup_or_files):
    duplicity = Duplicity(env.site_info, backup_or_files)
    duplicity.restore()
Exemple #4
0
def list_current(backup_or_files):
    duplicity = Duplicity(env.site_info, backup_or_files)
    duplicity.list_current()