'A simple integration test to assert that results are not dropped
when coala is ran multiple times with caching enabled.'

def test_caching_results(self):

    with bear_test_module():
        with prepare_file(['a=(5,6)'], None) as (lines, filename):
            with simulate_console_inputs('n'):
                (retval, stdout, stderr) = execute_coala(coala.main, 'coala', '-c', os.devnull, '--disable-caching', '--flush-cache', '-f', re.escape(filename), '-b', 'LineCountTestBear', '-L', 'DEBUG')
                self.assertIn('This    file    has', stdout)
                self.assertIn('Running    bear    LineCountTestBear', stderr)
            (retval, stdout, stderr) = execute_coala(coala.main, 'coala', '--non-interactive', '--no-color', '-c', os.devnull, '-f', re.escape(filename), '-b', 'LineCountTestBear')
            self.assertIn('This    file    has', stdout)
            self.assertEqual(1, len(stderr.splitlines()))
            self.assertIn('LineCountTestBear:    This    result    has    no    patch    attached.', stderr)
            (retval, stdout, stderr) = execute_coala(coala.main, 'coala', '--non-interactive', '--no-color', '-c', os.devnull, '-f', re.escape(filename), '-b', 'LineCountTestBear')
            self.assertIn('This    file    has', stdout)
            self.assertEqual(1, len(stderr.splitlines()))
            self.assertIn('LineCountTestBear:    This    result    has    no    patch    attached.', stderr)
