diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2019-12-04 18:05:08 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-04 18:05:08 -0600 |
commit | ba7ac53b75ed78553f9fb169ca53e659bd5ff0fb (patch) | |
tree | 2a20c96ea4fe921f3a3f90d37c7febf635348770 /lib | |
parent | e0e9fb4462a7329921e7ce0521db67043d7d8d41 (diff) | |
download | spack-ba7ac53b75ed78553f9fb169ca53e659bd5ff0fb.tar.gz spack-ba7ac53b75ed78553f9fb169ca53e659bd5ff0fb.tar.bz2 spack-ba7ac53b75ed78553f9fb169ca53e659bd5ff0fb.tar.xz spack-ba7ac53b75ed78553f9fb169ca53e659bd5ff0fb.zip |
Fix spack test when SPACK_ROOT isn't set (#13980)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/test/util/util_url.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/spack/spack/test/util/util_url.py b/lib/spack/spack/test/util/util_url.py index 24b40ac63c..855491bfe6 100644 --- a/lib/spack/spack/test/util/util_url.py +++ b/lib/spack/spack/test/util/util_url.py @@ -6,6 +6,7 @@ """Test Spack's URL handling utility functions.""" import os import os.path +import spack.paths import spack.util.url as url_util @@ -41,7 +42,7 @@ def test_url_parse(): assert(parsed.netloc == 'path') assert(parsed.path == '/to/resource') - spack_root = os.path.abspath(os.environ['SPACK_ROOT']) + spack_root = spack.paths.spack_root parsed = url_util.parse('$spack') assert(parsed.scheme == 'file') assert(parsed.netloc == '') @@ -56,7 +57,7 @@ def test_url_parse(): def test_url_local_file_path(): - spack_root = os.path.abspath(os.environ['SPACK_ROOT']) + spack_root = spack.paths.spack_root lfp = url_util.local_file_path('/a/b/c.txt') assert(lfp == '/a/b/c.txt') @@ -171,7 +172,7 @@ def test_url_join_local_paths(): 'https://mirror.spack.io/build_cache/my-package') # file:// URL path components are *NOT* canonicalized - spack_root = os.path.abspath(os.environ['SPACK_ROOT']) + spack_root = spack.paths.spack_root join_result = url_util.join('/a/b/c', '$spack') assert(join_result == 'file:///a/b/c/$spack') # not canonicalized |