From 1f41347ab82382147114f8694fdcce74db4a6eec Mon Sep 17 00:00:00 2001 From: Carson Woods Date: Thu, 27 Jun 2019 13:10:39 -0600 Subject: [PATCH] Share feature Unit testing --- lib/spack/spack/test/cmd/share.py | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lib/spack/spack/test/cmd/share.py diff --git a/lib/spack/spack/test/cmd/share.py b/lib/spack/spack/test/cmd/share.py new file mode 100644 index 00000000000..8732dcf6c28 --- /dev/null +++ b/lib/spack/spack/test/cmd/share.py @@ -0,0 +1,33 @@ +# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import pytest + +import spack.config +import spack.error + +from spack.main import SpackCommand + +share = SpackCommand('share') +install = SpackCommand('install') + + +@pytest.fixture() +def local_tmpdir(): + print("We be making them tmpdirs") + + +def test_activate(): + share('activate') + assert spack.config.get('config:shared') is True + + +def test_deactivate(): + # Ensures that this test can be run individually + # Activates shared mode so shared mode can be deactivated + if not spack.config.get('config:shared'): + share('activate') + share('deactivate') + assert spack.config.get('config:shared') is False