Merge "Ensure shell tests use isolated env variables set"

This commit is contained in:
Jenkins 2013-03-28 15:57:04 +00:00 committed by Gerrit Code Review
commit 593adf229a

View File

@ -20,10 +20,8 @@ FAKE_ENV = {'OS_USERNAME': 'username',
class ShellTest(utils.TestCase):
def make_env(self, exclude=None):
for var, val in FAKE_ENV.items():
if var == exclude:
continue
self.useFixture(fixtures.EnvironmentVariable(var, val))
env = dict((k, v) for k, v in FAKE_ENV.items() if k != exclude)
self.useFixture(fixtures.MonkeyPatch('os.environ', env))
def setUp(self):
super(ShellTest, self).setUp()