From 0be202dcd102ec06c78059472912938175cc5740 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Thu, 31 Aug 2017 16:29:30 +0000 Subject: [PATCH] Don't mock mkdtemp As far as I can tell there's no reason to do this, and it breaks the ability for NestedTempfile to clean up after the tests by forcing the file to go to the system /tmp directory (which I'm pretty sure is a security issue too...). It's also causing some weird errors in the gate so let's remove it. Change-Id: I04f3f569ff904e002758098cfd90b5bbb31c6afc Closes-Bug: 1714306 --- tripleo_common/tests/actions/test_logging_to_swift.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tripleo_common/tests/actions/test_logging_to_swift.py b/tripleo_common/tests/actions/test_logging_to_swift.py index 129f3651d..d1f489afb 100644 --- a/tripleo_common/tests/actions/test_logging_to_swift.py +++ b/tripleo_common/tests/actions/test_logging_to_swift.py @@ -126,15 +126,13 @@ class PrepareLogDownloadActionTest(base.TestCase): self.ctx = mock.MagicMock() @mock.patch('tripleo_common.utils.tarball.create_tarball') - @mock.patch('tempfile.mkdtemp') - def test_run_success(self, mock_mkdtemp, mock_create_tarball): + def test_run_success(self, mock_create_tarball): get_object_mock_calls = [ mock.call('logging-container', lf) for lf in self.log_files ] get_container_mock_calls = [ mock.call('logging-container') ] - mock_mkdtemp.return_value = '/tmp/test123' action = logging_to_swift.PrepareLogDownloadAction( 'logging-container', 'downloads-container', 3600