diff options
author | Barry Warsaw <barry@python.org> | 2015-01-22 18:38:30 -0500 |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2015-01-22 18:38:30 -0500 |
commit | 508670bdaf9545b6bcc8e2009e8bd3f08d6f8796 (patch) | |
tree | 613e6abbce7556f39ff2987bf7c4aa565b5a8a39 /tests/unittests/test_datasource/test_smartos.py | |
parent | b3bbd3985a75d00115e1623dc1ebd4248a7024a6 (diff) | |
download | vyos-cloud-init-508670bdaf9545b6bcc8e2009e8bd3f08d6f8796.tar.gz vyos-cloud-init-508670bdaf9545b6bcc8e2009e8bd3f08d6f8796.zip |
More test ports from mocker to mock.
Diffstat (limited to 'tests/unittests/test_datasource/test_smartos.py')
-rw-r--r-- | tests/unittests/test_datasource/test_smartos.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/unittests/test_datasource/test_smartos.py b/tests/unittests/test_datasource/test_smartos.py index 65675106..35d7ef5e 100644 --- a/tests/unittests/test_datasource/test_smartos.py +++ b/tests/unittests/test_datasource/test_smartos.py @@ -29,9 +29,12 @@ from .. import helpers import os import os.path import re +import shutil +import tempfile import stat import uuid + MOCK_RETURNS = { 'hostname': 'test-host', 'root_authorized_keys': 'ssh-rsa AAAAB3Nz...aC1yc2E= keyname', @@ -109,9 +112,10 @@ class TestSmartOSDataSource(helpers.FilesystemMockingTestCase): def setUp(self): helpers.FilesystemMockingTestCase.setUp(self) - # makeDir comes from MockerTestCase - self.tmp = self.makeDir() - self.legacy_user_d = self.makeDir() + self.tmp = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, self.tmp) + self.legacy_user_d = tempfile.mkdtemp() + self.addCleanup(shutil.rmtree, self.legacy_user_d) # If you should want to watch the logs... self._log = None |