testing.functional.test_selection module

class testing.functional.test_selection.IncludeExcludeFunctionalTest(methodName='runTest')[source]

Bases: testing.functional.FunctionalTestCase

This contains methods used in the tests below for testing the include, exclude and various filelist features.

complete_directory_tree = [['1', '2', '3', 'trailing_space ', '1.doc', '1.py'], ['1sub1', '1sub2', '1sub3'], ['1sub1sub1', '1sub1sub2', '1sub1sub3'], ['1sub1sub1_file.txt'], ['1sub1sub2_file.txt'], ['1sub1sub3_file.txt'], ['1sub2sub1', '1sub2sub2', '1sub2sub3'], ['1sub3sub1', '1sub3sub2', '1sub3sub3'], ['2sub1', '2sub2', '2sub3'], ['2sub1sub1', '2sub1sub2', '2sub1sub3'], ['2sub1sub1_file.txt'], ['2sub2sub1', '2sub2sub2', '2sub2sub3'], ['2sub3sub1', '2sub3sub2', '2sub3sub3'], ['3sub1', '3sub2', '3sub3'], ['3sub1sub1', '3sub1sub2', '3sub1sub3'], ['3sub2sub1', '3sub2sub2', '3sub2sub3'], ['3sub3sub1', '3sub3sub2', '3sub3sub3'], ['3sub3sub2_file.txt'], ['trailing_space sub1', 'trailing_space sub2'], ['trailing_space sub2_file.txt']]
directory_tree_to_list_of_lists(parent_directory)[source]

This takes a folder as an input and returns a list with its contents. If the directory has subdirectories, it returns a list of lists with the contents of those subdirectories.

expected_restored_tree = [['1', '2', '3', '1.py'], ['1sub1', '1sub2', '1sub3'], ['1sub1sub1', '1sub1sub3'], ['1sub1sub1_file.txt'], ['1sub2sub1'], ['1sub3sub3'], ['2sub1'], ['2sub1sub1'], ['2sub1sub1_file.txt'], ['3sub2', '3sub3'], ['3sub2sub1', '3sub2sub2', '3sub2sub3'], ['3sub3sub1', '3sub3sub2', '3sub3sub3'], ['3sub3sub2_file.txt']]
expected_restored_tree_with_trailing_space = [['1', '2', '3', 'trailing_space ', '1.py'], ['1sub1', '1sub2', '1sub3'], ['1sub1sub1', '1sub1sub3'], ['1sub1sub1_file.txt'], ['1sub2sub1'], ['1sub3sub3'], ['2sub1'], ['2sub1sub1'], ['2sub1sub1_file.txt'], ['3sub2', '3sub3'], ['3sub2sub1', '3sub2sub2', '3sub2sub3'], ['3sub3sub1', '3sub3sub2', '3sub3sub3'], ['3sub3sub2_file.txt'], ['trailing_space sub1', 'trailing_space sub2'], ['trailing_space sub2_file.txt']]
class testing.functional.test_selection.TestAbsolutePaths(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

Tests include/exclude options with absolute paths

test_absolute_paths_non_globbing()[source]

Test –include and –exclude work with absolute paths

class testing.functional.test_selection.TestAsterisks(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

Test to check that asterisks work as expected Exhibits the issue reported in Bug #884371 (https://bugs.launchpad.net/duplicity/+bug/884371). See the unit tests for more granularity on the issue.

restore_and_check()[source]

Restores the backup and compares to what is expected.

test_commandline_asterisks_double_both()[source]

test_commandline_include_exclude with double asterisks on both exclude and include lines.

test_commandline_asterisks_double_exclude_only()[source]

test_commandline_include_exclude with double asterisks on exclude lines.

test_commandline_asterisks_single_both()[source]

test_commandline_include_exclude with single asterisks on both exclude and include lines.

test_commandline_asterisks_single_excludes_only()[source]

test_commandline_include_exclude with single asterisks on exclude lines.

test_exclude_filelist_asterisks_double_asterisks()[source]

Exclude filelist with double asterisks replacing folders.

test_exclude_filelist_asterisks_none()[source]

Basic exclude filelist.

test_exclude_filelist_asterisks_single()[source]

Exclude filelist with asterisks replacing folders.

test_single_and_double_asterisks()[source]

This compares a backup using –include-globbing-filelist with a single and double *.

test_single_and_double_asterisks_includes_excludes()[source]

This compares a backup using –includes/–excludes with a single and double *.

class testing.functional.test_selection.TestCheckTestFiles(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

Tests the testfiles required by the exclude/include tests are as expected.

test_files_are_as_expected()[source]

Test that the contents of testfiles/select are as expected.

class testing.functional.test_selection.TestExcludeFilelistTest(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

Test –exclude-filelist using duplicity binary.

test_exclude_filelist()[source]

Test that exclude filelist works in the basic case

test_exclude_filelist_combined_imperfections()[source]

Test that exclude filelist works with imperfections in the input file

test_exclude_filelist_progress_option()[source]

Test that exclude filelist is unaffected by the –progress option

test_exclude_filelist_trailing_whitespace_folders_work_with_quotes()[source]

Test that folders with trailing whitespace in the names work correctly if they are enclosed in quotes

test_exclude_globbing_filelist_combined_imperfections()[source]

Test that exclude globbing filelist works with imperfections in the input file

class testing.functional.test_selection.TestExcludeIfPresent(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

This tests the behaviour of duplicity’s –exclude-if-present option

test_exclude_if_present_baseline()[source]

Test that duplicity normally backs up files

test_exclude_if_present_excludes()[source]

Test that duplicity excludes files with relevant tag

test_exclude_if_present_excludes_2()[source]

Test that duplicity excludes files with relevant tag

class testing.functional.test_selection.TestFolderIncludesFiles(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

This tests that including a folder includes the files within it

test_excludes_files_no_trailing_slash()[source]

This tests that excluding a folder excludes the files within it

test_excludes_files_trailing_slash()[source]

Excluding a folder excludes the files within it, if ends with /

test_excludes_files_trailing_slash_globbing_chars()[source]

Tests folder excludes with globbing char and /

test_includes_files()[source]

This tests that including a folder includes the files within it

test_includes_files_trailing_slash()[source]

This tests that including a folder includes the files within it

test_includes_files_trailing_slash_globbing_chars()[source]

Tests folder includes with globbing char and /

class testing.functional.test_selection.TestGlobbingReplacement(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

This tests the behaviour of the extended shell globbing pattern replacement functions.

test_globbing_replacement_in_includes()[source]

Test behaviour of the extended shell globbing pattern replacement functions in both include and exclude

class testing.functional.test_selection.TestIncludeExcludeOptions(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

This tests the behaviour of the duplicity binary when the include/exclude options are passed directly

test_include_exclude_basic()[source]

Test –include and –exclude work in the basic case

test_include_exclude_trailing_whitespace()[source]

Test that folders with trailing whitespace in the names work correctly when passing as include/exclude

class testing.functional.test_selection.TestIncludeExcludedForContents(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

Test to check that folders that are excluded are included if they contain includes of higher priority. Exhibits the issue reported in Bug #1408411 (https://bugs.launchpad.net/duplicity/+bug/1408411).

restore_and_check()[source]

Restores the backup and compares to what was expected (based on the filelist in write_filelist)

test_commandline_include_exclude()[source]

test an excluded folder is included for included contents when using commandline includes and excludes

test_exclude_filelist()[source]

test an excluded folder is included for included contents with an exclude-filelist (non-globbing)

test_exclude_globbing_filelist()[source]

test an excluded folder is included for included contents with an exclude-globbing-filelist

test_include_filelist()[source]

test an excluded folder is included for included contents with an include-filelist (non-globbing)

test_include_globbing_filelist()[source]

test an excluded folder is included for included contents with an include-globbing-filelist

write_filelist(filelist_name)[source]

Used by the below tests to write the filelist

class testing.functional.test_selection.TestIncludeFilelistTest(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

Test –include-filelist using duplicity binary.

test_include_filelist()[source]

Test that include filelist works in the basic case

test_include_filelist_combined_imperfections()[source]

Test that include filelist works with imperfections in the input file

test_include_filelist_workaround_combined_imperfections_no_wildcards()[source]

Test that include filelist works with imperfections in the input file

test_include_globbing_filelist_combined_imperfections()[source]

Test that include globbing filelist works with imperfections in the input file

class testing.functional.test_selection.TestLockedFoldersNoError(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

This tests that inaccessible folders do not cause an error

test_locked_baseline(*args, **kwargs)[source]

Test no error if locked in path but excluded

test_locked_excl_if_present(*args, **kwargs)[source]

Test no error if excluded locked with –exclude-if-present

class testing.functional.test_selection.TestTrailingSlash(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

Test to check that a trailing slash works as expected Exhibits the issue reported in Bug #932482 (https://bugs.launchpad.net/duplicity/+bug/932482).

restore_and_check()[source]

Restores the backup and compares to what is expected.

test_exclude_filelist_trailing_slashes()[source]

test_exclude_filelist_asterisks_none with trailing slashes.

test_exclude_filelist_trailing_slashes_double_wildcards_excludes()[source]

test_exclude_filelist_trailing_slashes with double wildcards in excludes.

test_exclude_filelist_trailing_slashes_double_wildcards_excludes_2()[source]

second test_exclude_filelist_trailing_slashes with double wildcards in excludes.

test_exclude_filelist_trailing_slashes_single_wildcards_excludes()[source]

test_exclude_filelist_trailing_slashes with single wildcards in excludes.

test_exclude_filelist_trailing_slashes_wildcards()[source]

test_commandline_asterisks_single_excludes_only with trailing slashes.

class testing.functional.test_selection.TestTrailingSlash2(methodName='runTest')[source]

Bases: testing.functional.test_selection.IncludeExcludeFunctionalTest

This tests the behaviour of globbing strings with a trailing slash

test_include_files_not_subdirectories()[source]

Test that a trailing slash glob followed by a * glob only matches files and not subdirectories

test_include_subdirectories_not_files()[source]

Test that a trailing slash glob only matches directories

test_no_trailing_slash()[source]

Test that including 1.py works as expected

test_trailing_slash()[source]

Test that globs with a trailing slash only match directories