diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2020-08-20 17:08:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 08:08:49 -0700 |
commit | 1addcff7240deecb3dca992cd5e45a40d02eb92d (patch) | |
tree | 1c8da4940d4389bca857b6447e79d62ddf087fcc | |
parent | d5c3b876e0d44639e01de60cc71ed18dfb18f321 (diff) | |
download | spack-1addcff7240deecb3dca992cd5e45a40d02eb92d.tar.gz spack-1addcff7240deecb3dca992cd5e45a40d02eb92d.tar.bz2 spack-1addcff7240deecb3dca992cd5e45a40d02eb92d.tar.xz spack-1addcff7240deecb3dca992cd5e45a40d02eb92d.zip |
Test "is_extension" after a round trip to dict (#18188)
closes #3887
closes #3853
-rw-r--r-- | lib/spack/spack/test/spec_semantics.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/spack/spack/test/spec_semantics.py b/lib/spack/spack/test/spec_semantics.py index d908ce7d89..e4d111a64f 100644 --- a/lib/spack/spack/test/spec_semantics.py +++ b/lib/spack/spack/test/spec_semantics.py @@ -987,3 +987,19 @@ class TestSpecSematics(object): s = Spec('mpileaks +unknown') with pytest.raises(UnknownVariantError, match=r'package has no such'): s.concretize() + + +@pytest.mark.regression('3887') +@pytest.mark.parametrize('spec_str', [ + 'git', 'hdf5', 'py-flake8' +]) +def test_is_extension_after_round_trip_to_dict(config, spec_str): + # x is constructed directly from string, y from a + # round-trip to dict representation + x = Spec(spec_str) + x.concretize() + y = Spec.from_dict(x.to_dict()) + + # Using 'y' since the round-trip make us lose build dependencies + for d in y.traverse(): + assert x[d.name].package.is_extension == y[d.name].package.is_extension |