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
(cherry picked from commit 0be202dcd1
)
This commit is contained in:
parent
6fe17f9a1f
commit
9a6bcf5ab6
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue