diff options
author | alalazo <massimiliano.culpo@googlemail.com> | 2017-08-28 21:55:34 +0200 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2017-08-29 00:44:43 -0700 |
commit | 462de9847c2271dbd7de149ae775e785c5d31daf (patch) | |
tree | 6e855017e65aa52bd49ab4757a8a7ffe14c9924d | |
parent | bf7b8615544059c075df814b2792e7b7fa4dcf24 (diff) | |
download | spack-462de9847c2271dbd7de149ae775e785c5d31daf.tar.gz spack-462de9847c2271dbd7de149ae775e785c5d31daf.tar.bz2 spack-462de9847c2271dbd7de149ae775e785c5d31daf.tar.xz spack-462de9847c2271dbd7de149ae775e785c5d31daf.zip |
Added unit tests for Spec.__init__ exceptional paths
-rw-r--r-- | lib/spack/spack/test/spec_semantics.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/spack/spack/test/spec_semantics.py b/lib/spack/spack/test/spec_semantics.py index 4ed7c635e9..2c7c1d22ed 100644 --- a/lib/spack/spack/test/spec_semantics.py +++ b/lib/spack/spack/test/spec_semantics.py @@ -707,3 +707,14 @@ class TestSpecSematics(object): check_constrain_not_changed( 'libelf^foo target=' + default_target, 'libelf^foo target=' + default_target) + + def test_exceptional_paths_for_constructor(self): + + with pytest.raises(TypeError): + Spec((1, 2)) + + with pytest.raises(ValueError): + Spec('') + + with pytest.raises(ValueError): + Spec('libelf foo') |