예제 #1
0
    def test_launch_with_specified_log_file(self, mock_tmp):
        target_func = mock.MagicMock()
        func = utils.tempest_log_wrapper(target_func)

        func(self.scenario, log_file='log_file')

        target_func.assert_called_once_with(self.scenario, log_file="log_file")
        self.assertEqual(0, mock_tmp.NamedTemporaryFile.call_count)
예제 #2
0
    def test_launch_with_specified_log_file(self, mock_tmp):
        target_func = mock.MagicMock()
        func = utils.tempest_log_wrapper(target_func)

        func(self.scenario, log_file='log_file')

        target_func.assert_called_once_with(self.scenario,
                                            log_file="log_file")
        self.assertEqual(0, mock_tmp.NamedTemporaryFile.call_count)
예제 #3
0
    def test_launch_without_specified_log_file(self, mock_tmp):
        mock_tmp.NamedTemporaryFile().name = "tmp_file"
        target_func = mock.MagicMock()
        func = utils.tempest_log_wrapper(target_func)

        func(self.scenario)

        target_func.assert_called_once_with(self.scenario,
                                            log_file="/tmp/dir/tmp_file")
예제 #4
0
    def test_launch_without_specified_log_file(self, mock_tmp):
        mock_tmp.NamedTemporaryFile().name = "tmp_file"
        target_func = mock.MagicMock()
        func = utils.tempest_log_wrapper(target_func)

        func(self.scenario)

        target_func.assert_called_once_with(self.scenario,
                                            log_file="/tmp/dir/tmp_file")