summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler/test_handler_growpart.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/test_handler/test_handler_growpart.py')
-rw-r--r--tests/unittests/test_handler/test_handler_growpart.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/unittests/test_handler/test_handler_growpart.py b/tests/unittests/test_handler/test_handler_growpart.py
index e653488a..e28067de 100644
--- a/tests/unittests/test_handler/test_handler_growpart.py
+++ b/tests/unittests/test_handler/test_handler_growpart.py
@@ -81,11 +81,11 @@ class TestConfig(TestCase):
self.cloud = cloud.Cloud(None, self.paths, None, None, None)
self.log = logging.getLogger("TestConfig")
self.args = []
- os.environ = {}
self.cloud_init = None
self.handle = cc_growpart.handle
+ @mock.patch.dict("os.environ", clear=True)
def test_no_resizers_auto_is_fine(self):
with mock.patch.object(
util, 'subp',
@@ -98,6 +98,7 @@ class TestConfig(TestCase):
mockobj.assert_called_once_with(
['growpart', '--help'], env={'LANG': 'C'})
+ @mock.patch.dict("os.environ", clear=True)
def test_no_resizers_mode_growpart_is_exception(self):
with mock.patch.object(
util, 'subp',
@@ -110,6 +111,7 @@ class TestConfig(TestCase):
mockobj.assert_called_once_with(
['growpart', '--help'], env={'LANG': 'C'})
+ @mock.patch.dict("os.environ", clear=True)
def test_mode_auto_prefers_growpart(self):
with mock.patch.object(
util, 'subp',