summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2017-08-28 21:55:34 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2017-08-29 00:44:43 -0700
commit462de9847c2271dbd7de149ae775e785c5d31daf (patch)
tree6e855017e65aa52bd49ab4757a8a7ffe14c9924d
parentbf7b8615544059c075df814b2792e7b7fa4dcf24 (diff)
downloadspack-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.py11
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')