diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-21 15:57:09 -0700 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2012-06-21 15:57:09 -0700 |
commit | 0f1c493aa032b60210fc63c6b120b833ba4c10de (patch) | |
tree | 146310449be5ef543f865bec22a5a6ac3953a792 /tests/unittests | |
parent | 4fa23cc17e565d90c5798835e27e7c06843a7f44 (diff) | |
download | vyos-cloud-init-0f1c493aa032b60210fc63c6b120b833ba4c10de.tar.gz vyos-cloud-init-0f1c493aa032b60210fc63c6b120b833ba4c10de.zip |
Use the mocker built-in method for creating temporary dirs (which it will cleanup)
Diffstat (limited to 'tests/unittests')
-rw-r--r-- | tests/unittests/test_util.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/unittests/test_util.py b/tests/unittests/test_util.py index 27c0fbd6..aea1aabb 100644 --- a/tests/unittests/test_util.py +++ b/tests/unittests/test_util.py @@ -1,6 +1,3 @@ -from shutil import rmtree -from tempfile import mkdtemp - import os import stat @@ -10,7 +7,7 @@ from mocker import MockerTestCase from cloudinit import util -class TestMergeDict(TestCase): +class TestMergeDict(MockerTestCase): def test_simple_merge(self): """Test simple non-conflict merge.""" source = {"key1": "value1"} @@ -105,12 +102,10 @@ class TestWriteFile(MockerTestCase): def setUp(self): super(TestWriteFile, self).setUp() # Make a temp directoy for tests to use. - self.tmp = mkdtemp(prefix="unittest_") + self.tmp = self.makeDir(prefix="unittest_") def tearDown(self): super(TestWriteFile, self).tearDown() - # Clean up temp directory - rmtree(self.tmp) def test_basic_usage(self): """Verify basic usage with default args.""" |