Reset env at end of test

This commit is contained in:
Mike Place 2015-02-06 08:40:08 -07:00 committed by rallytime
parent 26a0afdf57
commit b9fa5e4e29

View File

@ -1,5 +1,9 @@
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import
import os
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
@ -9,9 +13,19 @@ ensure_in_syspath('../../')
import salt.states.environ as envstate
import salt.modules.environ as envmodule
setup_env = {}
class TestEnvironState(TestCase):
@classmethod
def setUpClass(cls):
setup_env = os.environ
@classmethod
def tearDownClass(cls):
os.environ = setup_env
def setUp(self):
envstate.__env__ = 'base'
envstate.__opts__ = {'test': False}