def test_log_files(self):
    mock_instance1 = mock.Mock()
    mock_instance2 = mock.Mock()
    self.c._instances = {'i1': mock_instance1, 'i2': mock_instance2}
    mock_instance1.get_logfile_to_local.return_value = 'i1.log'
    mock_instance1.log_format = 'f'
    mock_instance2.get_logfile_to_local.return_value = 'i2.log'
    mock_instance2.log_format = 'f'
    log_specs = list(self.c.log_files())
    mock_instance1.finalise.assert_called_once_with()
    mock_instance2.finalise.assert_called_once_with()
    mock_instance1.get_logfile_to_local.assert_called_once_with('/some/dir')
    mock_instance2.get_logfile_to_local.assert_called_once_with('/some/dir')
    self.assertEqual(log_specs, [('i1', 'f', 'i1.log'), ('i2', 'f', 'i2.log')])
    mock_instance1.get_logfile_to_local.reset_mock()
    mock_instance2.get_logfile_to_local.reset_mock()
    log_specs = list(self.c.log_files())
    mock_instance1.get_logfile_to_local.assert_not_called()
    mock_instance2.get_logfile_to_local.assert_not_called()
    self.assertEqual(log_specs, [('i1', 'f', 'i1.log'), ('i2', 'f', 'i2.log')])
def test_log_files(self):
    mock_instance1 = mock.Mock()
    mock_instance2 = mock.Mock()
    self.c._instances = {'i1': mock_instance1, 'i2': mock_instance2}
    mock_instance1.get_logfile_to_local.return_value = 'i1.log'
    mock_instance1.log_format = 'f'
    mock_instance2.get_logfile_to_local.return_value = 'i2.log'
    mock_instance2.log_format = 'f'
    log_specs = list(self.c.log_files())
    mock_instance1.finalise.assert_called_once_with()
    mock_instance2.finalise.assert_called_once_with()
    mock_instance1.get_logfile_to_local.assert_called_once_with('/some/dir')
    mock_instance2.get_logfile_to_local.assert_called_once_with('/some/dir')
    self.assertEqual(log_specs, [('i1', 'f', 'i1.log'), ('i2', 'f', 'i2.log')])
    mock_instance1.get_logfile_to_local.reset_mock()
    mock_instance2.get_logfile_to_local.reset_mock()
    log_specs = list(self.c.log_files())
    mock_instance1.get_logfile_to_local.assert_not_called()
    mock_instance2.get_logfile_to_local.assert_not_called()
    self.assertEqual(log_specs, [('i1', 'f', 'i1.log'), ('i2', 'f', 'i2.log')])