summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2017-10-26 14:05:24 -0400
committerscheibelp <scheibel1@llnl.gov>2017-11-02 18:45:40 -0700
commitd5a3d9d20ea5b0c7a0d402c895cf2b63bc3132fe (patch)
tree15f1ed3b37d7ee7866dba2cabb488b662f1a407e /lib
parent13b669de8efad6a2d61717257df0d8fd986f75f9 (diff)
downloadspack-d5a3d9d20ea5b0c7a0d402c895cf2b63bc3132fe.tar.gz
spack-d5a3d9d20ea5b0c7a0d402c895cf2b63bc3132fe.tar.bz2
spack-d5a3d9d20ea5b0c7a0d402c895cf2b63bc3132fe.tar.xz
spack-d5a3d9d20ea5b0c7a0d402c895cf2b63bc3132fe.zip
view: test conflicting packages in views
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/cmd/view.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/spack/spack/test/cmd/view.py b/lib/spack/spack/test/cmd/view.py
index b4f3275172..a52edff786 100644
--- a/lib/spack/spack/test/cmd/view.py
+++ b/lib/spack/spack/test/cmd/view.py
@@ -85,6 +85,31 @@ def test_view_extension_remove(
assert not os.path.exists(os.path.join(viewpath, 'bin', 'extension1'))
+def test_view_extension_conflict(
+ tmpdir, builtin_mock, mock_archive, mock_fetch, config,
+ install_mockery):
+ install('extendee')
+ install('extension1@1.0')
+ install('extension1@2.0')
+ viewpath = str(tmpdir.mkdir('view'))
+ view('symlink', viewpath, 'extension1@1.0')
+ output = view('symlink', viewpath, 'extension1@2.0')
+ assert 'Package conflict detected' in output
+
+
+def test_view_extension_conflict_ignored(
+ tmpdir, builtin_mock, mock_archive, mock_fetch, config,
+ install_mockery):
+ install('extendee')
+ install('extension1@1.0')
+ install('extension1@2.0')
+ viewpath = str(tmpdir.mkdir('view'))
+ view('symlink', viewpath, 'extension1@1.0')
+ view('symlink', viewpath, '-i', 'extension1@2.0')
+ with open(os.path.join(viewpath, 'bin', 'extension1'), 'r') as fin:
+ assert fin.read() == '1.0'
+
+
def test_view_extension_global_activation(
tmpdir, builtin_mock, mock_archive, mock_fetch, config,
install_mockery):