testing.unit.test_selection module

class testing.unit.test_selection.MatchingTest(methodName='runTest')[source]

Bases: UnitTestCase

Test matching of file names against various selection functions

makeext(path)[source]
setUp()[source]

Hook method for setting up the test fixture before exercising it.

testRegexp()[source]

Test regular expression selection func

test_file_prefix_sf_exception()[source]

test_file_prefix_sf_exception - see if FilePrefix error is returned

test_glob_sf_exception()[source]

test_glob_sf_exception - see if globbing errors returned

test_glob_star_exclude()[source]

Test a few glob excludes, including **

test_glob_star_include()[source]

Test a few globbing patterns, including **

test_ignore_case()[source]

test_ignore_case - try a few expressions with ignorecase:

test_ignore_case_prefix_override()[source]

test_ignore_case - confirm that ignorecase: overrides default. might seem a bit odd as ignore_case=False is the default, but –filter-strictcase is implemented by explicitly setting this parameter. this test should also cause a stop-and-think if someone changes said default arg value for general_get_sf() in future.

test_literal_special_chars()[source]

Test literal match with globbing and regex special characters

test_other_filesystems()[source]

Test to see if –exclude-other-filesystems works correctly

test_root()[source]

test_root - / may be a counterexample to several of these..

test_scan()[source]

Tests what is returned for selection tests regarding directory scanning

test_simple_glob_double_asterisk()[source]

test_simple_glob_double_asterisk - primarily to check that the defaults used by the error tests work

test_tuple_exclude()[source]

Test exclude selection function made from a regular filename

test_tuple_include()[source]

Test include selection function made from a regular filename

class testing.unit.test_selection.ParseArgsTest(methodName='runTest')[source]

Bases: UnitTestCase

Test argument parsing

ParseTest(tuplelist, indicies, filelists=[])[source]

No error if running select on tuple goes over indicies

_paths_non_globbing()[source]

Test functional test _paths_non_globbing as a unittest

remake_filelists(filelist)[source]

Turn strings in filelist into fileobjs

setUp()[source]

Hook method for setting up the test fixture before exercising it.

test_alternate_root()[source]

Test select with different root

test_commandline_asterisks_double_both()[source]

Unit test the functional test TestAsterisks.test_commandline_asterisks_double_both

test_exclude_after_scan()[source]

Test select with an exclude after a pattern that would return a scan for that file

test_exclude_filelist()[source]

Exclude version of test_filelist

test_exclude_filelist_asterisk_1()[source]

Exclude version of test_include_filelist_asterisk

test_exclude_filelist_asterisk_2()[source]

Identical to test_exclude_filelist, but with the exclude “select” replaced with ‘*’

test_exclude_filelist_asterisk_3()[source]

Identical to test_exclude_filelist, but with the include “select” replaced with ‘*’

test_exclude_filelist_asterisk_4()[source]

Identical to test_exclude_filelist, but with numerous excluded folders replaced with ‘*’

test_exclude_filelist_asterisk_5()[source]

Identical to test_exclude_filelist, but with numerous included/excluded folders replaced with ‘*’

test_exclude_filelist_double_asterisk()[source]

Identical to test_exclude_filelist, but with all included/excluded folders replaced with ‘**’

test_exclude_filelist_single_asterisk_at_beginning()[source]

Exclude filelist testing limited functionality of functional test

test_filelist()[source]

Filelist glob test similar to above testParse2

test_filelist2()[source]

Filelist glob test similar to above testGlob

test_filelist_null_separator()[source]

test_filelist, but with null_separator set

test_files_from_implicit_parents()[source]

Confirm that –files-from includes parent directories implicitly

test_files_from_multiple_filelists()[source]

Check that –files-from can co-exist with other options using file lists

test_files_from_no_selections()[source]

Confirm that –files-from works in isolation

test_files_from_null_separator()[source]

Check that –files-from works with null separators when requested

test_files_from_with_exclusions()[source]

Confirm that –files-from still respects the usual file selection rules

test_files_from_with_inclusions()[source]

Confirm that –files-from still respects the usual file selection rules

test_glob()[source]

Test globbing expression

test_glob2()[source]

Test more globbing functions

test_glob3()[source]

regression test for bug 25230

test_globbing_replacement()[source]

Test functional test test_globbing_replacement as a unittest

test_globbing_replacement_filter_ignorecase()[source]

Test functional test test_globbing_replacement as a unittest - an alternate implementation of the above test which uses –filter-*case instead of the ignorecase: prefix.

test_include_exclude_basic()[source]

Test functional test test_include_exclude_basic as a unittest

test_include_filelist_1_leading_whitespace()[source]

Filelist glob test similar to globbing filelist, but with 1 leading whitespace on include

test_include_filelist_1_leading_whitespace_exclude()[source]

Filelist glob test similar to globbing filelist, but with 1 leading whitespace on exclude

test_include_filelist_1_trailing_whitespace()[source]

Filelist glob test similar to globbing filelist, but with 1 trailing whitespace on include

test_include_filelist_1_trailing_whitespace_exclude()[source]

Filelist glob test similar to globbing filelist, but with 1 trailing whitespace on exclude

test_include_filelist_2_leading_whitespaces()[source]

Filelist glob test similar to globbing filelist, but with 2 leading whitespaces on include

test_include_filelist_2_leading_whitespaces_exclude()[source]

Filelist glob test similar to globbing filelist, but with 2 leading whitespaces on exclude

test_include_filelist_2_trailing_whitespace_exclude()[source]

Filelist glob test similar to globbing filelist, but with 2 trailing whitespaces on exclude

test_include_filelist_2_trailing_whitespaces()[source]

Filelist glob test similar to globbing filelist, but with 2 trailing whitespaces on include

test_include_filelist_asterisk()[source]

Filelist glob test with * instead of ‘testfiles’

test_include_filelist_asterisk_2()[source]

Identical to test_filelist, but with the exclude “select” replaced with ‘*’

test_include_filelist_asterisk_3()[source]

Identical to test_filelist, but with the auto-include “select” replaced with ‘*’

test_include_filelist_asterisk_4()[source]

Identical to test_filelist, but with a specific include “select” replaced with ‘*’

test_include_filelist_asterisk_5()[source]

Identical to test_filelist, but with all ‘select’s replaced with ‘*’

test_include_filelist_asterisk_6()[source]

Identical to test_filelist, but with numerous excluded folders replaced with ‘*’

test_include_filelist_asterisk_7()[source]

Identical to test_filelist, but with numerous included/excluded folders replaced with ‘*’

test_include_filelist_check_excluded_folder_included_for_contents()[source]

Filelist glob test to check excluded folder is included if contents are

test_include_filelist_double_asterisk_1()[source]

Identical to test_filelist, but with the exclude “select’ replaced with ‘**’

test_include_filelist_double_asterisk_2()[source]

Identical to test_filelist, but with the include ‘select’ replaced with ‘**’

test_include_filelist_double_asterisk_3()[source]

Identical to test_filelist, but with the exclude ‘testfiles/select’ replaced with ‘**’

test_include_filelist_double_asterisk_4()[source]

Identical to test_filelist, but with the include ‘testfiles/select’ replaced with ‘**’

test_include_filelist_double_asterisk_5()[source]

Identical to test_filelist, but with all ‘testfiles/select’s replaced with ‘**’

test_include_filelist_trailing_slashes()[source]

Filelist glob test similar to globbing filelist, but with trailing slashes

test_include_filelist_trailing_slashes_and_double_asterisks()[source]

Filelist glob test similar to globbing filelist, but with trailing slashes and double asterisks

test_include_filelist_trailing_slashes_and_single_asterisks()[source]

Filelist glob test similar to globbing filelist, but with trailing slashes and single asterisks

test_include_filelist_with_blank_line()[source]

Filelist glob test similar to globbing filelist, but with a blank line.

test_include_filelist_with_blank_line_and_whitespace()[source]

Filelist glob test similar to globbing filelist, but with a blank line and whitespace.

test_include_filelist_with_full_line_comment()[source]

Filelist glob test similar to globbing filelist, but with a full-line comment.

test_include_filelist_with_unnecessary_double_quotes()[source]

Filelist glob test similar to globbing filelist, but with double quotes around one of the paths.

test_include_filelist_with_unnecessary_quotes()[source]

Filelist glob test similar to globbing filelist, but with quotes around one of the paths.

test_includes_files()[source]

Unit test the functional test test_includes_files

test_includes_files_trailing_slash()[source]

Unit test the functional test test_includes_files_trailing_slash

test_includes_files_trailing_slash_globbing_chars()[source]

Unit test functional test_includes_files_trailing_slash_globbing_chars

test_parse()[source]

Test just one include, all exclude

test_parse2()[source]

Test three level include/exclude

test_select_mode()[source]

Test seletion function mode switching with –filter-* options

uc_index_from_path(path)[source]

Takes a path type and returns path.index, with each element converted into unicode

class testing.unit.test_selection.TestGlobGetSf(methodName='runTest')[source]

Bases: UnitTestCase

Test glob parsing of the test_glob_get_sf function. Indirectly test behaviour of glob_to_re.

exclude_glob_tester(path, glob_string, root_path='/', ignore_case=False)[source]
glob_tester(path, glob_string, include_exclude, root_path, ignore_case)[source]

Takes a path, glob string and include_exclude value (1 = include, 0 = exclude) and returns the output of the selection function. None - means the test has nothing to say about the related file 0 - the file is excluded by the test 1 - the file is included 2 - the test says the file (must be directory) should be scanned

include_glob_tester(path, glob_string, root_path='/', ignore_case=False)[source]
test_glob_dirs_to_scan()[source]

Test parent directories are marked as needing to be scanned

test_glob_dirs_to_scan_glob()[source]

Test parent directories are marked as needing to be scanned - globs

test_glob_get_sf_2()[source]

Test same behaviour as the functional test test_globbing_replacement.

test_glob_get_sf_2_ignorecase()[source]

Test same behaviour as the functional test test_globbing_replacement, ignorecase tests.

test_glob_get_sf_3_double_asterisks_dirs_to_scan()[source]

Test double asterisk (**) replacement in glob_get_sf with directories that should be scanned

test_glob_get_sf_3_ignorecase()[source]

Test ignorecase in glob_get_sf

test_glob_get_sf_exclude()[source]

Test simple exclude.

test_glob_get_sf_exclude_root()[source]

Test simple exclude with / as the glob.

test_glob_get_sf_negative_square_brackets_range()[source]

Test negative square bracket (range) [!a,b,c] replacement in get_normal_sf.

test_glob_get_sf_negative_square_brackets_specified()[source]

Test negative square bracket (specified) [!a,b,c] replacement in get_normal_sf.