From 7411347a2958167f61682b24c5a314e4645ac821 Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Wed, 24 Jul 2019 11:30:27 -0700 Subject: tests: Test install of unconcretized spec (#12099) --- lib/spack/spack/test/install.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib') diff --git a/lib/spack/spack/test/install.py b/lib/spack/spack/test/install.py index 296322b7ed..e8467490fb 100644 --- a/lib/spack/spack/test/install.py +++ b/lib/spack/spack/test/install.py @@ -383,3 +383,20 @@ def test_pkg_install_log(install_mockery): # Cleanup shutil.rmtree(log_dir) + + +def test_unconcretized_install(install_mockery, mock_fetch, mock_packages): + """Test attempts to perform install phases with unconcretized spec.""" + spec = Spec('trivial-install-test-package') + + with pytest.raises(ValueError, match="only install concrete packages"): + spec.package.do_install() + + with pytest.raises(ValueError, match="fetch concrete packages"): + spec.package.do_fetch() + + with pytest.raises(ValueError, match="stage concrete packages"): + spec.package.do_stage() + + with pytest.raises(ValueError, match="patch concrete packages"): + spec.package.do_patch() -- cgit v1.2.3-60-g2f50