diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-10-31 05:02:06 +0100 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2020-11-17 10:04:13 -0800 |
commit | e7208b159800aa8e458fecc86668d250814ba3a7 (patch) | |
tree | 3b89ce59492f601d7e853dc867ed4c97e8d6b818 /lib | |
parent | d00e8394f8bf5ccfa90e2ecbc7ca6bb3c57dfd32 (diff) | |
download | spack-e7208b159800aa8e458fecc86668d250814ba3a7.tar.gz spack-e7208b159800aa8e458fecc86668d250814ba3a7.tar.bz2 spack-e7208b159800aa8e458fecc86668d250814ba3a7.tar.xz spack-e7208b159800aa8e458fecc86668d250814ba3a7.zip |
tests: verify to handle dependencies conditional on other dependencies
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/test/concretize.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/spack/spack/test/concretize.py b/lib/spack/spack/test/concretize.py index f80eb41981..f8b3b1eda2 100644 --- a/lib/spack/spack/test/concretize.py +++ b/lib/spack/spack/test/concretize.py @@ -675,3 +675,21 @@ class TestConcretize(object): s = Spec(spec_str).concretized() assert s.satisfies(expected_str) + + @pytest.mark.parametrize('spec_str,expected,unexpected', [ + ('py-extension3 ^python@3.5.1', [], ['py-extension1']), + ('py-extension3 ^python@2.7.11', ['py-extension1'], []), + ('py-extension3@1.0 ^python@2.7.11', ['patchelf@0.9'], []), + ('py-extension3@1.1 ^python@2.7.11', ['patchelf@0.9'], []), + ('py-extension3@1.0 ^python@3.5.1', ['patchelf@0.10'], []), + ]) + def test_conditional_dependencies(self, spec_str, expected, unexpected): + s = Spec(spec_str).concretized() + + for dep in expected: + msg = '"{0}" is not in "{1}" and was expected' + assert dep in s, msg.format(dep, spec_str) + + for dep in unexpected: + msg = '"{0}" is in "{1}" but was unexpected' + assert dep not in s, msg.format(dep, spec_str) |