fixed bug where earlier test was blowing away environment, causing an error on which('modulecmd')

This commit is contained in:
Gregory Becker 2016-05-23 17:39:06 -07:00
parent 1da6bbd146
commit 513aae5ef8

View file

@ -24,17 +24,20 @@
############################################################################## ##############################################################################
import unittest import unittest
import os import os
import copy
from spack.environment import EnvironmentModifications from spack.environment import EnvironmentModifications
class EnvironmentTest(unittest.TestCase): class EnvironmentTest(unittest.TestCase):
def setUp(self): def setUp(self):
os.environ.clear()
os.environ['UNSET_ME'] = 'foo' os.environ['UNSET_ME'] = 'foo'
os.environ['EMPTY_PATH_LIST'] = '' os.environ['EMPTY_PATH_LIST'] = ''
os.environ['PATH_LIST'] = '/path/second:/path/third' os.environ['PATH_LIST'] = '/path/second:/path/third'
os.environ['REMOVE_PATH_LIST'] = '/a/b:/duplicate:/a/c:/remove/this:/a/d:/duplicate/:/f/g' os.environ['REMOVE_PATH_LIST'] = '/a/b:/duplicate:/a/c:/remove/this:/a/d:/duplicate/:/f/g'
def tearDown(self):
pass
def test_set(self): def test_set(self):
env = EnvironmentModifications() env = EnvironmentModifications()
env.set('A', 'dummy value') env.set('A', 'dummy value')