spack.test.util package

Submodules

spack.test.util.editor module

spack.test.util.editor.bad_exe(tmpdir_factory)[source]
spack.test.util.editor.good_exe(tmpdir_factory)[source]
spack.test.util.editor.nosuch_exe(tmpdir_factory)[source]
spack.test.util.editor.test_editor_both_bad(nosuch_exe, vim_exe)[source]
spack.test.util.editor.test_editor_no_visual(good_exe)[source]
spack.test.util.editor.test_editor_no_visual_with_args(good_exe)[source]
spack.test.util.editor.test_editor_visual(good_exe)[source]
spack.test.util.editor.test_editor_visual_bad(good_exe, bad_exe)[source]
spack.test.util.editor.test_find_exe_from_env_var(good_exe)[source]
spack.test.util.editor.test_find_exe_from_env_var_bad_path(nosuch_exe)[source]
spack.test.util.editor.test_find_exe_from_env_var_no_editor()[source]
spack.test.util.editor.test_find_exe_from_env_var_with_args(good_exe)[source]
spack.test.util.editor.vim_exe(tmpdir_factory)[source]

spack.test.util.environment module

Test Spack’s environment utility functions.

spack.test.util.environment.deprioritize_system_paths()[source]
spack.test.util.environment.prepare_environment_for_tests()[source]
spack.test.util.environment.test_dump_environment(prepare_environment_for_tests, tmpdir)[source]
spack.test.util.environment.test_env_flag(prepare_environment_for_tests)[source]
spack.test.util.environment.test_filter_system_paths()[source]
spack.test.util.environment.test_get_path(prepare_environment_for_tests)[source]
spack.test.util.environment.test_is_system_path()[source]
spack.test.util.environment.test_path_put_first(prepare_environment_for_tests)[source]
spack.test.util.environment.test_path_set(prepare_environment_for_tests)[source]
spack.test.util.environment.test_prune_duplicate_paths()[source]
spack.test.util.environment.test_reverse_environment_modifications(working_env)[source]

spack.test.util.executable module

spack.test.util.executable.test_read_unicode(tmpdir, working_env)[source]
spack.test.util.executable.test_which(tmpdir)[source]
spack.test.util.executable.test_which_relative_path_with_slash(tmpdir, working_env)[source]
spack.test.util.executable.test_which_with_slash_ignores_path(tmpdir, working_env)[source]

spack.test.util.file_cache module

Test Spack’s FileCache.

spack.test.util.file_cache.file_cache(tmpdir)[source]

Returns a properly initialized FileCache instance

spack.test.util.file_cache.test_write_and_read_cache_file(file_cache)[source]

Test writing then reading a cached file.

spack.test.util.file_cache.test_write_and_remove_cache_file(file_cache)[source]

Test two write transactions on a cached file. Then try to remove an entry from it.

spack.test.util.log_parser module

spack.test.util.log_parser.test_log_parser(tmpdir)[source]

spack.test.util.mock_package module

spack.test.util.mock_package.test_mock_package_possible_dependencies()[source]
spack.test.util.mock_package.test_mock_repo_is_virtual()[source]

spack.test.util.path module

spack.test.util.path.fixed_lines = ["==> [2021-06-23-15:59:05.020387] './configure' '--prefix=/Users/gamblin2/padding-log-test/opt/[padded-to-512-chars]/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga", '/Users/gamblin2/Workspace/spack/lib/spack/env/clang/clang -dynamiclib -install_name /Users/gamblin2/padding-log-test/opt/[padded-to-512-chars]/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.11 -fPIC -O2 -fPIC -DHAVE_HIDDEN -o libz.1.2.11.dylib adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo  -lc', 'rm -f /Users/gamblin2/padding-log-test/opt/[padded-to-512-chars]/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/lib/libz.a']

unpadded versions of padded_lines, with [padded-to-X-chars] replacing the padding

spack.test.util.path.padded_lines = ["==> [2021-06-23-15:59:05.020387] './configure' '--prefix=/Users/gamblin2/padding-log-test/opt/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga", '/Users/gamblin2/Workspace/spack/lib/spack/env/clang/clang -dynamiclib -install_name /Users/gamblin2/padding-log-test/opt/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.11 -fPIC -O2 -fPIC -DHAVE_HIDDEN -o libz.1.2.11.dylib adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo  -lc', 'rm -f /Users/gamblin2/padding-log-test/opt/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla/darwin-bigsur-skylake/apple-clang-12.0.5/zlib-1.2.11-74mwnxgn6nujehpyyalhwizwojwn5zga/lib/libz.a']

Some lines with lots of placeholders

spack.test.util.path.test_longest_prefix_re()[source]

Test that longest_prefix_re generates correct regular expressions.

spack.test.util.path.test_no_substitution()[source]

Ensure that a line not containing one full path placeholder is not modified.

spack.test.util.path.test_output_filtering(capfd, install_mockery, mutable_config)[source]

Test filtering padding out of tty messages.

spack.test.util.path.test_padding_substitution(padded, fixed)[source]

Ensure that all padded lines are unpadded correctly.

spack.test.util.path.test_partial_substitution()[source]

Ensure that a single placeholder path component is replaced

spack.test.util.path.test_short_substitution()[source]

Ensure that a single placeholder path component is replaced

spack.test.util.prefix module

Tests various features of spack.util.prefix.Prefix

spack.test.util.prefix.test_multilevel_attributes()[source]

Test attributes of attributes, like prefix.share.man

spack.test.util.prefix.test_prefix_attributes()[source]

Test normal prefix attributes like prefix.bin

spack.test.util.prefix.test_prefix_join()[source]

Test prefix join prefix.join(...)

spack.test.util.prefix.test_string_like_behavior()[source]

Test string-like behavior of the prefix object

spack.test.util.spack_lock_wrapper module

Tests for Spack’s wrapper module around llnl.util.lock.

spack.test.util.spack_lock_wrapper.test_disable_locking(tmpdir)[source]

Ensure that locks do no real locking when disabled.

spack.test.util.spack_lock_wrapper.test_lock_checks_group(tmpdir)[source]

Ensure lock checks work with a self-owned, non-self-group repo.

spack.test.util.spack_lock_wrapper.test_lock_checks_user(tmpdir)[source]

Ensure lock checks work with a self-owned, self-group repo.

spack.test.util.spack_yaml module

spack.test.util.spack_yaml.check_blame(element, file_name, line=None)[source]

Check that config blame config gets right file/line for an element.

This runs spack config blame config and scrapes the output for a particular YAML key. It thne checks that the requested file/line info is also on that line.

Line is optional; if it is None we just check for the file_name, which may just be a name for a special config scope like _builtin or command_line.

spack.test.util.spack_yaml.get_config_line(pattern, lines)[source]

Get a configuration line that matches a particular pattern.

spack.test.util.spack_yaml.test_config_blame(config)[source]

check blame info for elements in mock configuration.

spack.test.util.spack_yaml.test_config_blame_defaults()[source]

check blame for an element from an override scope

spack.test.util.spack_yaml.test_config_blame_with_override(config)[source]

check blame for an element from an override scope

spack.test.util.util_gpg module

spack.test.util.util_gpg.has_socket_dir()[source]
spack.test.util.util_gpg.test_parse_gpg_output_case_one()[source]
spack.test.util.util_gpg.test_parse_gpg_output_case_three()[source]
spack.test.util.util_gpg.test_parse_gpg_output_case_two()[source]
spack.test.util.util_gpg.test_really_long_gnupghome_dir(tmpdir, has_socket_dir)[source]

spack.test.util.util_string module

spack.test.util.util_string.test_plural()[source]

spack.test.util.util_url module

Test Spack’s URL handling utility functions.

spack.test.util.util_url.test_git_url_parse(url, parts)[source]
spack.test.util.util_url.test_url_join_absolute_paths()[source]
spack.test.util.util_url.test_url_join_local_paths()[source]
spack.test.util.util_url.test_url_local_file_path()[source]
spack.test.util.util_url.test_url_parse()[source]

Module contents