testing.functional.test_selection module
- class testing.functional.test_selection.IncludeExcludeFunctionalTest(methodName='runTest')[source]
Bases:
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:
IncludeExcludeFunctionalTest
Tests include/exclude options with absolute paths
- class testing.functional.test_selection.TestAsterisks(methodName='runTest')[source]
Bases:
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.
- 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_single()[source]
Exclude filelist with asterisks replacing folders.
- class testing.functional.test_selection.TestCheckTestFiles(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
Tests the testfiles required by the exclude/include tests are as expected.
- class testing.functional.test_selection.TestExcludeFilelistTest(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
Test –exclude-filelist using duplicity binary.
- 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
- class testing.functional.test_selection.TestExcludeIfPresent(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
This tests the behaviour of duplicity’s –exclude-if-present option
- class testing.functional.test_selection.TestFilesFrom(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
Tests behaviours when –files-from is used
- test_files_from_multiple_filelists()[source]
Use filelists for both –files-from and –include-filelist
- test_files_from_trailing_space_folder()[source]
Check that trailing space is preserved where it isn’t delimited by another path component or implied by another path in the same file
- test_files_from_with_exclusions()[source]
Apply some –exclude rules to a backup fileset defined by –files-from
- test_files_from_with_inclusions()[source]
Apply some –exclude rules to a backup fileset defined by –files-from
- testfiles_numbers = ['2', '2/2sub3', '2/2sub3/2sub3sub2', '2/2sub3/2sub3sub1', '2/2sub3/2sub3sub3', '2/2sub1', '2/2sub1/2sub1sub3', '2/2sub1/2sub1sub2', '2/2sub1/2sub1sub1', '2/2sub1/2sub1sub1/2sub1sub1_file.txt', '2/2sub2', '2/2sub2/2sub2sub3', '2/2sub2/2sub2sub1', '2/2sub2/2sub2sub2', '1.doc', '1.py', '1', '1/1sub3', '1/1sub3/1sub3sub2', '1/1sub3/1sub3sub1', '1/1sub3/1sub3sub3', '1/1sub1', '1/1sub1/1sub1sub2', '1/1sub1/1sub1sub2/1sub1sub2_file.txt', '1/1sub1/1sub1sub3', '1/1sub1/1sub1sub3/1sub1sub3_file.txt', '1/1sub1/1sub1sub1', '1/1sub1/1sub1sub1/1sub1sub1_file.txt', '1/1sub2', '1/1sub2/1sub2sub3', '1/1sub2/1sub2sub2', '1/1sub2/1sub2sub1', '3', '3/3sub3', '3/3sub3/3sub3sub3', '3/3sub3/3sub3sub1', '3/3sub3/3sub3sub2', '3/3sub3/3sub3sub2/3sub3sub2_file.txt', '3/3sub2', '3/3sub2/3sub2sub1', '3/3sub2/3sub2sub3', '3/3sub2/3sub2sub2', '3/3sub1', '3/3sub1/3sub1sub3', '3/3sub1/3sub1sub1', '3/3sub1/3sub1sub2']
- class testing.functional.test_selection.TestFolderIncludesFiles(methodName='runTest')[source]
Bases:
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 /
- class testing.functional.test_selection.TestGlobbingReplacement(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
This tests the behaviour of the extended shell globbing pattern replacement functions.
- class testing.functional.test_selection.TestIncludeExcludeFilterModes(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
Direct use of –include/–exclude with –filter-* mode switches used.
- test_error_on_redundant_filter_option()[source]
Test for explicit specification of default filter options _only_.
- test_error_on_trailing_filter_option()[source]
Test –filter-* as the last file selection option, which has no effect and should result in an error.
- test_include_exclude_basic_with_modes()[source]
Test –include and –exclude work in the same way as done by TestIncludeExcludeSelectOptions, but when –filter-* switches in a way which should not change the outcome (with this specific file set).
- test_include_exclude_trailing_whitespace_with_modes()[source]
Test that folders with trailing whitespace in the names work correctly when passing as include/exclude, specifically in literal mode.
- test_literal_special_files()[source]
No reason this shouldn’t work as the differences in file selection code for literal-vs-regex-vs-globs is dealing only with strings. this is included for completeness and against the remote future possibility that those different filter implementations one day touch filesystem meta data and pick up interactions with special file types or attributes…
- class testing.functional.test_selection.TestIncludeExcludeOptions(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
This tests the behaviour of the duplicity binary when the include/exclude options are passed directly
- class testing.functional.test_selection.TestIncludeExcludedForContents(methodName='runTest')[source]
Bases:
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)
- class testing.functional.test_selection.TestIncludeFilelistTest(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
Test –include-filelist using duplicity binary.
- 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
- class testing.functional.test_selection.TestIncludeSpecialGlobChars(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
Use of literal selection functions to match shell globbing characters
- test_filelist_special_shell_chars()[source]
This test is the same as test_literal_special_shell_chars() except that an include file-list is used instead.
- test_globbing_special_shell_chars()[source]
Selecting files using both literal and globbing selection functions on a fileset which contains literal shell characters
- test_literal_special_shell_chars()[source]
Selecting files using literal selection functions which would have different interactions if interpreted as shell globs, e.g. ‘[01]’ which will not match the same as a glob, or 0?1 which would also match 0*1 in the same folder (where ? and * appear literally in the filenames).
- class testing.functional.test_selection.TestLockedFoldersNoError(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
This tests that inaccessible folders do not cause an error
- class testing.functional.test_selection.TestSkipSocket(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
Tests correct handling of unix domain sockets in backuyp source
- sock_path = '/tmp/testfiles/various_file_types/socket'
- class testing.functional.test_selection.TestTrailingSlash(methodName='runTest')[source]
Bases:
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).
- 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.
- class testing.functional.test_selection.TestTrailingSlash2(methodName='runTest')[source]
Bases:
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
- class testing.functional.test_selection.TestUnicode(methodName='runTest')[source]
Bases:
IncludeExcludeFunctionalTest
Tests include/exclude options with unicode paths